0

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 } ?>

1 Answer 1

0

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
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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