Support » Fixing WordPress » Pagination: How to display sidebar content on front page only?

  • I need to place sidebar content on my blog that appears on the home page only.

    This means the content should display only at mysite.com and not at mysite.com/page/2/

    However, both the home page and inside pages use the same template, index.php, which means they both use the same sidebar.

    Is there a conditional script that would prevent my home page sidebar from appearing on inside pages?

    Thanks.

Viewing 1 replies (of 1 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    there are lots of conditional tags, you could try to use:
    http://codex.wordpress.org/Conditional_Tags

    for instance:
    <?php if(is_home()) { get_sidebar(); } ?>

    or
    <?php if(!is_paged()) { get_sidebar(); } ?>
    this one might still show the sidebar on the first page of archives or categories, if there is no archive.php

Viewing 1 replies (of 1 total)
  • The topic ‘Pagination: How to display sidebar content on front page only?’ is closed to new replies.