Search results switch template on Page 2
-
I’ve created a separate template for search results at my site in order to show only the title, meta data and summary.
The relevant code from my search.php looks like this:
<?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'search' ); ?> <?php endwhile; ?>
And then the template is in content-search.php.
This works as expected on the first page of search results, but as soon as you get to Page 2 the posts switch to the regular template.
I wonder if it might have something to do with infinite scroll, but I’m not sure.
Any ideas?
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Search results switch template on Page 2’ is closed to new replies.