Thesis Tutorial — How To Remove Sidebars, Header And Footer From Specific Pages In Thesis

August 8, 2011

Thesis Tutorial — How To Remove Sidebars, Header And Footer From Specific Pages

The website is a collection of different web pages where each page is designed for a specific purpose. The Home page presents the overview of the website while services pages are designed to pitch your services and the FAQs focus on providing support and help to the clients.

Each webpage is designed bearing the primary purpose in mind and thus may not require to feature sidebars, header and footer. As a general assumption, the services/product featuring pages essentially are the landing page of the website and thus need to be designed with minimal elements and the blog on the other hand should be highly interactive and provide relevant post links as featured posts, relevant posts or archives in sidebars and footers. Thus the elementary requirements of each page vary and thus you may at times need to:

  1. Remove The Sidebars From Specific Pages (Or Posts)
  2. Remove The Header From Specific Pages (Or Posts)
  3. Remove The Footer From Specific Pages (Or Posts)

Remove The Sidebars From Specific Pages Or Posts In Thesis

Thesis features a “No Sidebars” page template which makes it simple and easy to remove the sidebars from the specific pages. Here is a simple tutorial to do so.

  1. Login to WordPress and click Pages in the left panel.
  2. On the Pages screen select the page for which you want to remove the sidebars and click Edit to activate the edit mode.
  3. Locate Pages Attribute section in the right-hand side and select No Sidebars from Template drop-down menu.

    no sidebars Thesis Tutorial — How To Remove Sidebars, Header And Footer From Specific Pages In Thesis

    Select No Sidebars to remove sidebars on specific pages

  4. Update the page.

To remove the sidebar from particular posts / single posts page follow the steps given below:

  1. Open custom_functions.php in the editor of your choice (learn how to edit custom_functions.php).
  2. Add the following code to hide the sidebars from specific posts.
    
    function show_rem_sidebars() {
    if (is_page('7')) // For single posts you can use is_single() and pass the Post ID as parameter
    return true;
    else
    return false;
    }
    add_filter('thesis_show_sidebars', 'show_rem_sidebars');

Check out the ultimate guide on sidebar customization to do more with the sidebars.

Remove The Header From Specific Pages Or Posts In Thesis

Thesis provides a filter thesis_show_header which allows you to specify the pages for which you want to show / hide the header. Add the following code to your custom_functions.php to remove the header from the specific pages.


function show_rem_header() {
if (is_page('7')) // For single posts you can use is_single() and pass the Post ID as parameter
return true;
else
return false;
}
add_filter('thesis_show_header', 'show_rem_header');

Remove The Footer From Specific Pages Or Posts In Thesis

Just like the filter for determining the execution of header, Thesis provides a filter thesis_show_footer which allows you to specify the pages for which you want to show / hide the footer. You can remove the footer from the specific pages by adding the following code to your custom_functions.php.


function show_rem_footer() {
if (is_page('7')) // For single posts you can use is_single() and pass the Post ID as parameter
return true;
else
return false;
}
add_filter('thesis_show_footer', 'show_rem_footer');

 

Join 37,807 others and get free tutorials & tips on design & development using Wordpress on, Thesis & Genesis!

Need help with Wordpress, Thesis or Genesis?

Are you a designer or a developer looking for a hand with Wordpress, Thesis or Genesis? Or perhaps want to save time with a project? Get in touch and let's get the ball rolling! Check out our Thesis development, PSD to Thesis & other services.

{ 7 comments on Thesis Tutorial — How To Remove Sidebars, Header And Footer From Specific Pages In Thesis… read them below or add one }

Michael October 12, 2011 at 7:55 am

When I use these codes it removes the header, footer, and sidebars from every page not just one. Do you know why?

Shivanand Sharma October 12, 2011 at 8:47 am

Yes, because you haven’t provided the condition in your code.

Tracey January 10, 2012 at 9:48 pm

Hi there,

thanks for this comprehensive tutorial; I tried it to ensure I could target a single page, which worked great.

Do you by any chance know how just to remove the header, but still leave the nav bar & feature box in place? I’ve tried this code from the support forum, to no avail:
function remove_header() {
if (is_home()) {
remove_action(‘thesis_hook_header’, ‘thesis_default_header’);
}
}
add_action(‘thesis_hook_before_html’, ‘remove_header’);

thanks!!
Tracey

Tracey January 10, 2012 at 9:50 pm

Oops – meant to say, I only want to remove the header on one single page…
thanks…

Shivanand Sharma January 10, 2012 at 11:00 pm

As per your code the header will be removed only from the home page (provided that the code works; I haven’t tried it). To exclude a single page instead of is_home(), you can use is_page(‘yourpagenumberORtitleORslug’). To remove it froma post use is_single(‘yourpagenumberORtitleORslug’).

Tracey January 10, 2012 at 11:07 pm

Hi Shivanand, my question was, do you know ONLY how to remove the banner (image) instead of everything in the header? Your code works but it takes away more than I would like, hence my query – if not, I’ll ask again in the forum :) Many thanks!

Shivanand Sharma January 11, 2012 at 9:22 am

If you can give me the URL of the page I can give you the code.

Comment on Thesis Tutorial — How To Remove Sidebars, Header And Footer From Specific Pages In Thesis

You can add images to your comment by clicking here.

Previous post:

Next post:

X

Wordpress, Thesis, Genesis tutorials from Binary Turf — one tutorial a day. Subscribe & sharpen your web design skills.

Name:

Email:

We respect your email privacy.