Querying specific groups based on parameters

I needed to fetch the group avatar, group permalink and group description on the basis of “slug” or “id” (if by slug is not possible)….

I tried using The Groups Loop / bp_has_groups(), since it shows that i can pass slug as a parameter…. but it doesn’t seem to work for me…. can someone tell me whats going wrong?

a. the value of slug that I will be passing in bp_has_groups has to be a variable…. $slug_params for it to solve my purpose.
b. I tried using bp_has_groups(‘slug = $slug_params’), (‘slug = “$slug_params”‘), even tried removing the $slug_params and replacing it with a fixed value put under quotes….none of it seems to work for me….

meanwhile, i am looking at the functions you mentioned….if this does not work, i will need them only…

btw, just to bring it your attention: on codex.buddypress.org, the search form is not working…

also on the page of bp_has_groups(), in the documentation it is written bp_has_site_groups()
This might be right, but I could not find bp_has_site_groups() functions anywhere in the files in groups folder…so thought i will point these two issues out to you guys…hope its cool…

oopsss…had forgotten to remove them from bp_group_permalink() and description_excerpt()
actually when the earlier solution was not working, I tried that thinking may be there is the problem…
anyway…have removed that…and have changed to $slug_params = $details_result;
still no success…

@r-a-y
when i am printing $slug_params, i am basically doing the same thing as printing $details_result
isnt it???
btw, i had printed that out as well…
actually i am generating a list in this section (where I am stuck in fetching avatar and other details)….and every other bit is doing exactly what it should…
again, thanks for being patient here…really appreciate it…

Hi @r-a-y and @stuffsone, I am new to php, WP+BP. Could you please help me with exclude few Groups From the Loop. I would like to create a general group and donot want to display it in the Sidebar. Can we use the exclude parameters of bp_has_group in widget_logic? If yes can you help me with the syntax?
Also I want to use the group functionality for Projects (as there is no plugin which fits the bill – I think I tried most of them ( Collabpress, BP GTM, Propel…)
I am planning to create groups as projects but want them to be displayed under project tab (and not displayed under Group tab)
do you have any other recommendation?

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Querying specific groups based on parameters’ is closed to new replies.