BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › 10 Private Messages Per Page
- This topic has 6 replies, 2 contibutors, and was last updated 9 years, 4 months ago by Alyssa.
Question
July 14, 2015 at 10:28 pm #42669@bentasm1Howdy,
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
July 15, 2015 at 6:09 pm #42749@alyssa-buddyboss
AlyssaParticipant@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.
July 15, 2015 at 6:22 pm #42757@bentasm1I 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.phpAnd none of those 3 locations worked.
Where would this file be placed in the child theme?
Thanks!
July 16, 2015 at 7:13 pm #42807@alyssa-buddyboss
AlyssaParticipant@bentasm1 the first location is correct:
/wp-content/themes/boss-child/buddypress/bp-messages/bp-messages-template.phpI’ll test this out as well.
July 16, 2015 at 7:29 pm #42809@alyssa-buddyboss
AlyssaParticipant@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_pageJuly 16, 2015 at 8:35 pm #42818@bentasm1Aah, 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.phpAnd 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
July 17, 2015 at 12:21 pm #42884
- The question ‘10 Private Messages Per Page’ is closed to new replies.