• Resolved joxyzan

    (@joxyzhan)


    Howdy!

    Thank you for making a great user manager plugin.

    I’ve run into a problem though. I?am successfully using this functions.php snippet to exclude category 3 from the WordPress homepage:

    function exclude_category_home( $query ) {
    if ( $query->is_front_page ) {
    $query->set( 'cat', '-3' );
    }
    return $query;
    }
    add_filter( 'pre_get_posts', 'exclude_category_home' );

    Your query for listing the users posts works fine:

    $the_query = wpum_get_posts_for_profile( $data->user->ID );

    But a query of my own, running on a tab I added on the profile page, unintentionally excludes category 3:

    $the_query = new WP_Query( array( 'meta_key' => 'fetcher', 'meta_value' => $user_ID ) );

    I can’t find out if it’s my query or your plugin that causes this problem. Can you? ??

Viewing 1 replies (of 1 total)
  • Thread Starter joxyzan

    (@joxyzhan)

    I found the solution!
    Changing the second line of my snippet to:

    if ( $query->is_main_query() && $query->is_front_page() ) {
Viewing 1 replies (of 1 total)
  • The topic ‘Category excluded on profile page’ is closed to new replies.