Support » Themes and Templates » Unique Front Page (Dynamic Content)

  • Resolved coplan


    My blog’s theme has a block on its front page which provides highlights for all the latest and most popular posts. I want it to disappear, however, when a person is browsing posts through the next/previous links. I’ve tried using the is_home() function and the is_front_page() function, but it seems to believe all of the browsing through the next/previous links is the home or the front page.

    How would I alter the theme so that the box only shows up on the front page?

    If this makes no sense, a visit to my site may help. My site is The box in question is the one in the center with the latest posts, latest photos and popular posts. IF you go to the bottom and click “older posts”, you of course get the older posts, but the box is still there – and I don’t want it to be.

    Much appreciated for any help you can proide

Viewing 3 replies - 1 through 3 (of 3 total)
  • Can you post the code from the page that generates the box… likely index.php of your theme.

    The Conditional Tag is_paged() should work for you:

    if (is_paged()) {
    //this is main page or 1st page of archives
    } else {
    //this is 2nd page of posts either main or archive

    Awesome…the is_paged worked well for me. This is essentially what I did:

    <?php if(!is_paged() && !is_single() && !is_page()): ?>
      <!-- the block code goes here -->
    <?php endif; ?>

    The !is_paged() appears to be placing it only on the home page. I had to add the !is_single() to keep it from popping up on single posts and I added the !is_page() to keep it from popping up on page elements.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unique Front Page (Dynamic Content)’ is closed to new replies.