Skip to:
Content
Pages
Categories
Search
Top
Bottom

Using pre_get_posts in bbPress queries


  • Allyson
    Participant

    @allysonsouza

    Hi, I’m trying to make some filters in my single-forum and other pages queries, but my changes with pre_get_posts results in “Content not found”.

    Here’s a example of my code:

    function bbpress_site_queries( $query ) {
    	if ( $query->is_main_query() && $query->is_single( 'forum' ) ) {
    		$query->set( 'order', 'DESC' );
        }
    }
    add_action( 'pre_get_posts', 'bbpress_site_queries' );

    What is wrong? There’s other way, better to modify bbPress queries? I want to change queries to make in front-end some order and other filters.

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