BuddyBoss Home – Web Support Forums Themes Boss. theme 10 Private Messages Per Page

Viewing 7 posts - 1 through 7 (of 7 total)
  • Question

    #42669
    @bentasm1

    Howdy,

    I’m struggling to sort this one out on my own. Reviewed the BuddyPress github and couldn’t quite figure it out, combed through the Boss theme files, dont see anything in there either.

    Private messages display 10 per page. Any snippet available to change this to 50 without modifying /bp-messages/bp-messages-template.php directly in the plugin?

    Cheers

    Ben

    Answers

    #42749

    Alyssa
    Participant
    @alyssa-buddyboss

    @bentasm1 unfortunately I do not know of any other way than to edit that file. You can place the file in a child theme so it is upgrade safe.

    #42757
    @bentasm1

    I didnt’ realize that was a template file. So, I tried copying it from:

    /wp-content/plugins/buddypress/bp-messages/bp-messages-template.php

    to:
    /wp-content/themes/boss-child/buddypress/bp-messages/bp-messages-template.php
    -and-
    /wp-content/themes/boss-child/buddypress/bp-messages-template.php
    -and-
    /wp-content/themes/boss-child/bp-messages-template.php

    And none of those 3 locations worked.

    Where would this file be placed in the child theme?

    Thanks!

    #42807

    Alyssa
    Participant
    @alyssa-buddyboss

    @bentasm1 the first location is correct:
    /wp-content/themes/boss-child/buddypress/bp-messages/bp-messages-template.php

    I’ll test this out as well.

    #42809

    Alyssa
    Participant
    @alyssa-buddyboss

    @bentasm1 wrong template structure.
    buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php is the one to edit and copy to the child theme. Then change this:
    bp_has_message_threads( bp_ajax_querystring( 'messages' ) )
    to this:
    bp_has_message_threads( bp_ajax_querystring( 'messages' ).'per_page=20' )
    NOTE: Might need a & before per_page

    #42818
    @bentasm1

    Aah, that’s a hidden little gem there. Copied it but turned out, Boss theme already has this template being used, so if I used the bp-default file all the cool Boss styling gets deleted. Here’s the step by step for anyone else who needs to change the per pages of private messages:

    Copy: /wp-content/themes/boss/buddypress/members/single/messages/messages-loop.php
    To: /wp-content/themes/boss-child/buddypress/members/single/messages/messages-loop.php

    And then……..

    Line #2: Change this:
    <?php if ( bp_has_message_threads( bp_ajax_querystring( ‘messages’ ) ) ) : ?>

    To:
    <?php if ( bp_has_message_threads( bp_ajax_querystring( ‘messages’ ) . ‘per_page=50’ ) ) : ?>

    …..where the 50 number is how many private messages per page you wish to display.

    Thanks TJ. Read an article about you on WP Tavern (I think?) about your operation here. Good read. Keep up the good work.

    Ben

    #42884

    Alyssa
    Participant
    @alyssa-buddyboss

    @bentasm1 gah, yes, sorry about that. Glad you were able to figure it out.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The question ‘10 Private Messages Per Page’ is closed to new replies.