Search results switch template on Page 2
-
I think this problem is due to infinite scroll.
I created a separate template for my search results 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 scroll down and “Page 2” loads, the posts switch to the regular template.
Any ideas on how to prevent this?
The page I need help with: [log in to see the link]
Viewing 15 replies - 1 through 15 (of 15 total)
Viewing 15 replies - 1 through 15 (of 15 total)
- The topic ‘Search results switch template on Page 2’ is closed to new replies.