BuddyBoss Home – Web Support Forums Themes Boss. theme $query->set( 'meta_query', $metaquery); breaks BuddyPanel

Viewing 3 posts - 1 through 3 (of 3 total)
  • Question

    #55611
    @ricochetsupport

    I’m attempting to alter the main_query with

    add_action('pre_get_posts', 'ricochet_main_feed_query', 1 );
    function ricochet_main_feed_query($query) {
    	if ($query->is_main_query() && is_front_page()) {
    			$metaquery = [[
    
    					'key' => 'promote',
    					'value' => 1,
    					'compare' => '=',
    				]];
    			$query->set( 'meta_query', $metaquery	);
    
    	}
    
    }

    This works fine for displaying the posts that I want. We have a members-only feed and a public feed, and only posts that have been “promoted” should visible on the main feed (i.e., the front page). So as I said, the above code displays the posts I want it to on the front page. The problem is that the BuddyPanel will not expand/collapse anymore when the meta_query is set.

    Answers

    #55616
    @ricochetsupport

    This was apparently being caused by a conflict with another custom function. Problem solved.

    #55634

    Anonymous
    @

    Hi @ricochetsupport, Glad it solved.

    If you have any other concern please let us know.

    Regards

Viewing 3 posts - 1 through 3 (of 3 total)
  • The question ‘$query->set( 'meta_query', $metaquery); breaks BuddyPanel’ is closed to new replies.