WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a WP-Touch theme and I have a template file that looks like this:

<?php get_header(); ?>  
<?php locate_template( 'featured-post.php', true, false ); ?>
<?php locate_template( 'blog-loop.php', true ); ?>
<?php get_footer(); ?>

Inside the blog-loop I load in a number of posts with a basic loop then at the bottom of the page there is an ajax call(built into the theme) that loads in the next set of posts. This works great accept the ajax call is made inside of blog-loop and is loading in the featured-post query as well. So every time a user clicks 'load more' they get a featured article between all of the new posts.

How can I fix this? Can I have a conditional statement that allows the featured article to show up only on the first load?

share|improve this question

I was able to find a solution to my own problem.

For anyone needing to solve this in the future, Wordpress offers a set of conditional statements for just able everything, include pagination.

<?php get_header(); ?>
<?php if ( ! $paged || $paged < 2 ){ ?>
<?php locate_template( 'featured-post.php', true, false ); ?>
<?php }?>
<?php locate_template( 'blog-loop.php', true ); ?>
<?php get_footer(); ?>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.