Activity

  • Scott started the question $query->set( 'meta_query', $metaquery); breaks BuddyPanel in the forum Boss. theme 8 years, 3 months ago

    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.