Skip to:
Content
Pages
Categories
Search
Top
Bottom

posts_per_page filter not working on pagination


  • Indrekkor
    Participant

    @indrekhirsnik

    Trying to display fewer replies for mobile users.

    Before getting to the mobile users ran into a problem that the following filter:

    
    function mobile_replies() {
    $args['posts_per_page'] = 10;
    return $args;
    }
    
    add_filter('bbp_before_has_replies_parse_args', 'mobile_replies', 10, 1 ); 

    Works, but, it does not change pagination values in the view loop-single-topic.php problem is with the function bbp_topic_pagination()

    For whatever reason it is not affected by filters.

    In addition changing the rendering type to “list” with this function affects everything else, but not the pagination show in single forum view.

    function bbpress_custom_pagination( $args ) {
    
    	$args['type'] = 'list';
    	$args['prev_text'] = '«';
    	$args['next_text'] = '»';
    
    	return $args;
    
    }
    add_filter( 'bbp_topic_pagination', 'bbpress_custom_pagination' );
    add_filter( 'bbp_forum_pagination', 'bbpress_custom_pagination' );
    add_filter( 'bbp_replies_pagination', 'bbpress_custom_pagination' );
    
    

    Any thoughts?

    Probably adding filters to wrong functions

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    You probably have reply threading activated, threaded replies has no pagination so it shows all the replies on one page.
    See ‘Settings > Forums’

    Pascal.


    Indrekkor
    Participant

    @indrekhirsnik

    Threaded replies is disabled.

    The problem is that pagination is showing, but the filter above does not affect pagination of single forum view. Single forum view topic pagination count can only be edited by changing the global value in settings, but i do not want to change it from there inorder to give different posts per page value to mobile users.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar