404 on search pagination, but not paginated taxonomy? (3 posts)

  1. Leo Blanchette
    Posted 3 years ago #

    Am I writing this query correctly? I'm trying to get paginated results for a custom taxonomy off of the search page.

    Search works fine on the taxonomy page, but a search page gives a 404 on page 2.

    if ( is_search() ) {
                $image_tags = get_query_var( 's' );
            } else {
                $image_tags = get_query_var( 'image-tags' );

    Then I determine the search attributes -

    if ( is_tax( 'image-tags' ) || is_search() ) {
                $tax_query = array(
                         'taxonomy' => 'image-tags',
                        'field' => 'name',
                        'terms' => explode( ' ', $image_tags ),
                        'operator' => 'AND'

    Then this is what gets sent to the WP_query class

    $local_query = array(
    	    'post-type' => 'image',
                'paged' => $paged,
                'tax_query' => $tax_query,

    I truly hope someone might have some guidance. I've been on this for a loonggg time now. Answers on wordpress forums have not been forthcoming...I suspect its a hard problem.

  2. Leo Blanchette
    Posted 3 years ago #

    LOL Finding my own questions on google. Still unanswered.

  3. openwp3
    Posted 3 years ago #

    Same here Leo. I have a similar issue and not getting any responses. Here are a few posts I found that might be of help to you:



Topic Closed

This topic has been closed to new replies.

About this Topic