WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 have an if statement already in my loop to display content based on post type. I was wondering if there was a way that I could say to ignore that section if it is the front page/homepage. Here's a sample of my code:

    <?php if( get_post_type() == 'reviews' ) { ?>

<div class="post-review">

                <div class="review-score">

            other div stuff

            </div>

<?php } ?>
share|improve this question
up vote 0 down vote accepted

Check for is_front_page() and if you want to catch the first page only inspect get_query_var( 'paged' ) too:

if ( is_front_page() and 2 > get_query_var( 'paged' ) )
{
    // we are on the first page of the front page
}
share|improve this answer

Your Answer

 
discard

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.