WordPress.org

Ready to get started?Download WordPress

Forums

Hide Something in the sidebar on single pages (5 posts)

  1. Gianko
    Member
    Posted 8 years ago #

    I want some info on my sidebar.php to show only on the index page.

    I'm using this, but it does not seen to work


    <?php if (!$single) { ?>
    Info on the sidebar.php not showing in single posts pages
    <?php } ?>

    that's on WP 2.0

    any comments?

  2. Direkt
    Member
    Posted 8 years ago #

    You mean basically you want your sidebar on only the index page, right?

  3. Direkt
    Member
    Posted 8 years ago #

    If I'm right, you'll want to do this.

    <?php if (is_home()) { side bar content } ?>

    <?php if (is_single()) { single side bar content } ?>

    <?php if (is_page("archives") || is_archive() || is_search()) { all other pages side bar content } ?>

  4. Terry
    Member
    Posted 8 years ago #

    <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
    have info link or whatever in here
    <?php } ?>

    Try that - hopefully it pasted ok

  5. Gianko
    Member
    Posted 8 years ago #

    @Direkt: nope, I have the sidebar on all pages but I don't want the "Recent Post" list on the index.

    Thanks a lot.. I was using WP 1.2 tags!!! :oops:

    BTW, I'm using asides, is there any way to make those poste not to show in the get_archives() post listing?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags