Forums

How to remove something from the sidebar on a single page (6 posts)

  1. danaldinho
    Member
    Posted 3 years ago #

    Hey,

    Ok, so if you want to add something into the sidebar on wordpress like the archives bit for example, then you can add this before the code:

    <?php if (is_single()) { ?>

    Then the archives bit will only show in the sidebar on the single page and won't show on pages like the index etc.

    But I want to remove something from the single page in the sidebar, so for example; the archives bit will show in the sidebar on every page, but when we get to a single page, it disappears.

    Hope you all understood me :p

    Thanks :)

  2. Monkeyboy
    Member
    Posted 3 years ago #

    This may not be the best way of doing it, but it might work...

    <?php if (is_single()) {
    // do nothing
    } else {
    *archive code goes here*
    } ?>
  3. danaldinho
    Member
    Posted 3 years ago #

    I did that, but it gave me this error:

    Parse error: syntax error, unexpected '<'

  4. danaldinho
    Member
    Posted 3 years ago #

    Just tried this:

    <?php if (is_single()) {
    // do nothing
    } else { ?>
    *archive code goes here*
    <?php } ?>

    And it didn't work as it still showed the archives bit on the "single page".

  5. danaldinho
    Member
    Posted 3 years ago #

    Anyone got a way for this?

  6. danaldinho
    Member
    Posted 3 years ago #

    Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.