Tagged: pagination
I create a New Tab “Forum Posts under the Forums slug
I add Shortcode for a single Forum [bbp-single-forum id=1643]
The 1st page shown is good, showing 5 Topics at https://incahoot.org/members/user1/forums/forumposts/
The “Next” pagination link takes me to
Which just takes me tome my homwe page
What do I do to make the pagination work?
Hi,
Thank you for reporting it.It is a bug in bbPress shortcode. Their pagination code doe snot work with current page(if permalink is enabled).
Please add following to your wp-content/plugins/bp-custom.php
or in your theme’s function.phpadd_filter( 'bbp_before_bbp_topic_pagination_parse_args', function ( $args ) { if ( ! function_exists( 'bp_is_user' ) || ! bp_is_user() ) { return $args; } $args['base'] = add_query_arg( 'paged', '%#%' ); return $args; } );
That should fix the pagination. Please let me know if it works or not?
Thank you
BrajeshHi Brajesh
Your code produced this error:
Your PHP code changes were rolled back due to an error on line 732 of file wp-content/themes/evolve/functions.php. Please fix and try saving again.
syntax error, unexpected ‘&’
The code I entered was
/*
From Brajesh. Fix pagination problem with Buddypress shortcodes
————————————— */
add_filter( 'bbp_before_bbp_topic_pagination_parse_args', function ( $args ) {if ( ! function_exists( 'bp_is_user' ) || ! bp_is_user() ) {
return $args;
}
$args['base'] = add_query_arg( 'paged', '%#%' );return $args;
} );Can you fix please?
Thanks
Hi,
It seems you copied the code from forum email notification. The error is you copied entity encoded code.Please copy the code from my post above and use it.
Regards
BrajeshThe forum email notifications get encoded and that’s why you received the error.
Regards
BrajeshHi,
Please use this code instead. This will work.add_filter( 'bbp_topic_pagination', function ( $args ) { if ( ! function_exists( 'bp_is_user' ) || ! bp_is_user() ) { //return $args; } $args['base'] = add_query_arg( 'paged', '%#%' ); return $args; } );
Regards
BrajeshThank you for the update. I am glad it is resolved.
Regards
Brajesh
The topic ‘ [Resolved] Pagination not working with Shortcodes in Profile Tabs Plugin’ is closed to new replies.