Skip to:
Content
Pages
Categories
Search
Top
Bottom

The Groups Loop – per_page optional

Viewing 9 replies - 1 through 9 (of 9 total)
  • @nit3watch

    Participant

    K been a while now and I still can’t come right. Tried using “This is the way you can add the various parameters directly” and “If you want to use multiple parameters it’s sometimes easier to use an array like this”.

    Am I editing the right file? If I modify the groups loop; that should limit the pages of all groups right? Can some one give me an example of the modified groups loop limiting something so I can understand where I’m going wrong please.

    @djpaul

    Keymaster

    Hi @Nit3watch
    I’m going to assume you’re editing groups/groups-loop.php, hopefully in your theme and not the core BuddyPress files ;)

    Find this bit near the top of the file:
    if ( bp_has_groups( bp_ajax_querystring( ‘groups’ ) ) )

    And change it to something like:
    if ( bp_has_groups( bp_ajax_querystring( ‘groups’ . ‘&per_page=5’ ) ) )

    @nit3watch

    Participant

    @DJPaul yip its in my theme. Bleh, I can be stupid. Like 3 days ago I added “wp_redirect( get_option(‘siteurl’) . ‘/about’);” to my theme. Kinda the same thing.. Still getting to grasps with php
    Ta

    @nit3watch

    Participant

    @DJPaul Ive tried it in my theme and bp-default and can’t come right? Could you please check if its on my side?

    Ive cleared my cache and everything I can think of, im pritty sure its not my side?

    @nit3watch

    Participant

    K got some1 else, anton, to confirm that it doesn’t work. would try play around with the changing the default pagination limit of 20 but that would be in the core I take it..

    @nit3watch

    Participant

    @r-a-y, is this not maybe a bug or something as Iv’e tried various approaches and cant come right?

    @r-a-y

    Keymaster

    You have to fool around with the “bp_dtheme_ajax_querystring” filter.

    Boone provided a small tutorial on this:
    https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-can-i-set-show-newblogposts-as-default-on-acitivity-stream/?topic_page=2&num=15#post-42623

    Modify the code to detect a group and change the per_page variable if you’re on a group.

    @nit3watch

    Participant

    thank you Ill try it out

    @nit3watch

    Participant

    @boonebgorges ray pointed me in the direction of the “How can I set “Show NewBlogPosts” as default on acitivity-stream?” https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-can-i-set-show-newblogposts-as-default-on-acitivity-stream/?topic_page=1&num=15

    and said I must play around with the ajax filter, Iv’e tried using your example suited to groups but I can’t get it working. Could you help me please?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘The Groups Loop – per_page optional’ is closed to new replies.
Skip to toolbar