0

Right now i have this code:

function exclude_categorii( $query ) {
  if ( is_admin() || ! $query->is_main_query() )
    return;

  if ( $query->is_tax ) {

    $query->set( 'category__in', array( 1, 14 ) );

  }

}
add_action( 'pre_get_posts', 'exclude_categorii' );

And it's searching only in cat "1"

I want to search in both categories with the relation "OR"

Thanks in advance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.