Forums

Disable sidebar in a particular page (4 posts)

  1. xodeus
    Member
    Posted 3 years ago #

    Is it possible somehow to disable sidebars on a particular page. I only want this on one page, where I run my simple:press forum.

  2. stvwlf
    Member
    Posted 3 years ago #

    Is it possible somehow to disable sidebars on a particular page

    yes. you have to find the template page from which you are calling simple:press - most likely page.php, unless you have created a custom page template.

    within that file, find the line that calls the sidebar, it will possibly be like this: <?php get_sidebar(); ?>

    wrap it in an if statement

    <?php if(!is_page('forum')) {
             get_sidebar();
          }
    ?>

    instead of the word forum in my example, use the page slug (URL) of the page from which you are calling simple:press

    this code will load the sidebar on all pages except the forum page

  3. leewutzke
    Member
    Posted 2 years ago #

    Thanks for this post. It worked for me. I was able remove the side bar on my about page. I want to also remove the side bar on my links page. How do I put more than one page in this if statement?

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    <?php if( !is_page('About') && !is_page('Links') ) {
             get_sidebar();
          }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic