Support

Account

Home Forums Front-end Issues Category excluded in WP_Query Reply To: Category excluded in WP_Query

  • I would recommend also adding a check that the snippet is only impacting the main page query so this line:

    if ( $query->is_front_page ) {

    Would change to:

    if ( $query->is_main_query() && $query->is_front_page() ) {