• I have a site that uses a custom search form and when there are multiple pages of the results, and I click on page 2, I get a 404 error – not found. Here’s the function PHP code:

    if ($_GET['tags']!='') {
        function my_modify_main_query( $query ) {
            if ( $query->is_main_query() ) :
                if ($_GET['any']=='any') {
                    $query->set('tag__in',$_GET['tags']);
                }
                else {
                    $query->set('tag__and', $_GET['tags']);
                }
                $query->set('s', '');
            endif;
        }
        add_action( 'pre_get_posts', 'my_modify_main_query' );
    }

    If you perform a search, you will see what I’m saying – Try comedy tag since it has the most results if you want to see how the search is being done. http://romanceanimefans.com/blog

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Search Results not showing correctly’ is closed to new replies.