• Hi,

    I was wondering if anyone knew a way to not display the sidebar in pages made in wp… is there a line of code or a special plugin for that ?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • In your template, the siderbar is inserted using <?php get_sidebar(); ?>. You can either delete that, if you don’t want the sidebar at all, or you could wrap it in conditionals:

    So, to stop it being displayed on the home page, you’d go:

    <?php if ( !is_home() ) {
    get_sidebar();
    } ?>

    The exclamation mark means “not” so the above means, in English, “If is not home, get sidebar.”

    Thread Starter guillaumeb

    (@guillaumeb)

    Thank you maerk I knew a line of code would be enough but…i’m sort of a noob in php !

    Oh, that’s fine, we all start somewhere ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to not include sidebar in pages’ is closed to new replies.