WordPress.org

Ready to get started?Download WordPress

Forums

Disable sidebar for specific category (5 posts)

  1. morktron
    Member
    Posted 7 years ago #

    Hi, does anyone know how to disable the sidebar for a specific category?

    I don't know php so this is what I came up with:

    <?php
    if (is_category('3')) {
    // no sidebar for category 3
    } else {
    // otherwise show sidebar
    (get_sidebar(''))
    ?>

    but of course it doesn't work. Any ideas?

  2. morktron
    Member
    Posted 7 years ago #

    Is there anybody out there? just nod if you can hear me.

  3. charle97
    Member
    Posted 7 years ago #

    you need a closing bracket.

  4. morktron
    Member
    Posted 7 years ago #

    Thanks Charlie97, I don't know how to write php yet, please could you tell what a php closing bracket is?

    thanks :)

  5. charle97
    Member
    Posted 7 years ago #

    <?php
    if (is_category('3')) {
    // no sidebar for category 3
    } else {
    // otherwise show sidebar
    (get_sidebar(''))
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic