Skip to:
Content
Pages
Categories
Search
Top
Bottom

List All Topics on Topic Archive Page, No Pagination

  • @mattbru

    Participant

    What is the secret to modifying/changing the query on the topic archive page? I want to list all topics on that page rather than have 16, and i do not want pagination. On normal wordpress post types this is easily done with pre_get_posts filter. But how is it done with bbpress?

    I have tried this:

    
    function bbp_change_topic_archive_query_args( $query = array() ) {
    	$query['order'] = 'asc';
    	$query['orderby'] = 'title';
    	$query['post_count'] = -1;
    	$query['posts_per_page'] = -1;
    	return $query;
    }
    add_filter('bbp_has_topics_query','bbp_change_topic_archive_query_args');

    and this: (but this requires a shortcode to work properly)

    function bbp_my_register_custom_views() {
    	bbp_register_view( 
    		'asc', __( 'A-Z' ), 
    		array(
    			'orderby' => 'title',
    			'order' => 'ASC',
    			'post_count' => '-1',
    			'posts_per_page' => '-1',
    			'hide_empty' => false,
    		), false );
    }
    add_action( 'bbp_register_views', 'bbp_my_register_custom_views' );

    What else can be done?
    This has to be possible.

    wp v5.2.2, bbp 2.5.14
    site is a pw protected site. I can give access privately if necessary.

    Thanks!

  • You must be logged in to reply to this topic.
Skip to toolbar