title: Remove sidebar on some pages on Wordpress
body: <p>I am trying to edit a Worpress template. Everything work as as expected except that I wish to have a page without sidebar - which is not included in that template.</p>
  
  <p>To achieve this I went to the template's folder, duplicated the "page.php" and named it page-nosidebar.php. Over there I deleted the get_sidebar call script. Here is how it looks like now:</p>
  
  <pre><code>&lt;?php /*
      Template Name: No Sidebars
  */ ?&gt;
  
  &lt;?php get_header(); ?&gt;  
      &lt;div id="single_cont"&gt;
  
          &lt;div class="single_left"&gt;
  
              &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;          
                  &lt;h1 class="single_title"&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
                  &lt;div class="single_inside_content"&gt;
                  &lt;?php the_content(); ?&gt;
                  &lt;/div&gt;&lt;!--//single_inside_content--&gt;
                  &lt;br /&gt;&lt;br /&gt;
                  &lt;?php //comments_template(); ?&gt;
              &lt;?php endwhile; else: ?&gt;
                  &lt;h3&gt;Sorry, no posts matched your criteria.&lt;/h3&gt;
              &lt;?php endif; ?&gt;                    
  
          &lt;/div&gt;&lt;!--//single_left--&gt;
  
  
  
          &lt;div class="clear"&gt;&lt;/div&gt;
  
      &lt;/div&gt;&lt;!--//single_cont--&gt;
  
  &lt;?php get_footer(); ?&gt;
  </code></pre>
  
  <p>After this, I went to the page editor and assigned this new template to the page I wanted to have no sidebar. Problem? Sidebar still shows up.</p>
  
  <p>How should I do? Thanks in advance!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>footer.php</p>
  
  <pre><code>&lt;div class="clear"&gt;&lt;/div&gt;   
  
      &lt;div id="footer"&gt;
         &lt;div class="footer_text"&gt; &lt;?php echo date("Y"); ?&gt; Company. Powered by &lt;a href="http://www.site.se"&gt;Company&lt;/a&gt;&lt;/div&gt;
         &lt;/div&gt;&lt;!--//footer--&gt;
  
      &lt;/div&gt;&lt;!--//main_container--&gt;
  
  &lt;?php wp_footer(); ?&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>header.php</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"&gt; &lt;head&gt;  &lt;link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'&gt; &lt;link href='http://fonts.googleapis.com/css?family=Raleway:400,100,200' rel='stylesheet' type='text/css'&gt; &lt;link href='http://fonts.googleapis.com/css?family=Cabin:700' rel='stylesheet' type='text/css'&gt;   &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;    &lt;title&gt;&lt;?php wp_title('&amp;laquo;', true, 'right'); ?&gt; &lt;?php bloginfo('name'); ?&gt;&lt;/title&gt;             &lt;?php wp_head(); ?&gt;   &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /&gt;   &lt;!--[if lt IE 9]&gt;   &lt;script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"&gt;&lt;/script&gt; &lt;![endif]--&gt;                 &lt;!--&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt;--&gt; &lt;script type="text/javascript" src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/js/jquery-latest.js"&gt;&lt;/script&gt;   &lt;script type="text/javascript" src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/js/scripts.js"&gt;&lt;/script&gt;   &lt;script src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/js/jquery.infinitescroll.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;       &lt;link rel="stylesheet" href="&lt;?php bloginfo('stylesheet_url'); ?&gt;" type="text/css" media="screen" title="no title" charset="utf-8"/&gt;    &lt;script type="text/javascript"&gt; $(document).ready( function($){   $('#content_inside').infinitescroll({
  
      navSelector  : "div.load_more_text",            
                     // selector for the paged navigation (it will be hidden)
      nextSelector : "div.load_more_text a:first",    
                     // selector for the NEXT link (to page 2)
      itemSelector : "#content_inside .home_post_box"
                     // selector for all items you'll retrieve   },function(arrayOfNewElems){
  
      $('.home_post_box').hover(      function() {            $(this).find('.home_post_text').css('display','block');         },      function () {           $(this).find('.home_post_text').css('display','none');      }   );  
  
        //$('.home_post_cont img').hover_caption();
  
       // optional callback when new content is successfully loaded in.
  
       // keyword `this` will refer to the new DOM content that was just added.
       // as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
       //                   all the new elements that were found are passed in as an array
      });   }   ); &lt;/script&gt;   &lt;/head&gt; &lt;body&gt; &lt;?php $shortname = "neue"; ?&gt;  &lt;?php if(get_option($shortname.'_background_image_url','') != "") { ?&gt; &lt;style type="text/css"&gt;   body { background-image: url('&lt;?php echo get_option($shortname.'_background_image_url',''); ?&gt;'); } &lt;/style&gt; &lt;?php } ?&gt; &lt;div id="main_container"&gt;   &lt;div id="header"&gt;       &lt;div class="left"&gt;          &lt;?php if(get_option($shortname.'_custom_logo_url','') != "") { ?&gt;
                &lt;a href="&lt;?php bloginfo('url'); ?&gt;"&gt;&lt;img src="&lt;?php echo stripslashes(stripslashes(get_option($shortname.'_custom_logo_url',''))); ?&gt;" class="logo" /&gt;&lt;/a&gt;            &lt;?php } else { ?&gt;
                &lt;a href="&lt;?php bloginfo('url'); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/logo.jpg" class="logo" /&gt;&lt;/a&gt;             &lt;?php } ?&gt;                              &lt;/div&gt;
                  &lt;div class="right"&gt;             &lt;div class="head_social"&gt;
                  &lt;?php if(get_option($shortname.'_twitter_link','') != "") { ?&gt;
                      &lt;a href="&lt;?php echo get_option($shortname.'_twitter_link',''); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/twitter-icon.png" /&gt;&lt;/a&gt;
                  &lt;?php } ?&gt;
                  &lt;?php if(get_option($shortname.'_facebook_link','') != "") { ?&gt;
                      &lt;a href="&lt;?php echo get_option($shortname.'_facebook_link',''); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/facebook-icon.png" /&gt;&lt;/a&gt;
                  &lt;?php } ?&gt;
                  &lt;?php if(get_option($shortname.'_google_plus_link','') != "") { ?&gt;
                      &lt;a href="&lt;?php echo get_option($shortname.'_google_plus_link',''); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/google-plus-icon.png" /&gt;&lt;/a&gt;
                  &lt;?php } ?&gt;
                  &lt;?php if(get_option($shortname.'_dribbble_link','') != "") { ?&gt;
                      &lt;a href="&lt;?php echo get_option($shortname.'_dribbble_link',''); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/dribbble-icon.png" /&gt;&lt;/a&gt;
                  &lt;?php } ?&gt;
                  &lt;?php if(get_option($shortname.'_pinterest_link','') != "") { ?&gt;
                      &lt;a href="&lt;?php echo get_option($shortname.'_pinterest_link',''); ?&gt;"&gt;&lt;img src="&lt;?php bloginfo('stylesheet_directory'); ?&gt;/images/pinterest-icon.png" /&gt;&lt;/a&gt;
                  &lt;?php } ?&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;           &lt;/div&gt;&lt;!--//head_social--&gt;
                          &lt;div class="header_menu"&gt;   &lt;!--
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="#"&gt;HOME&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;ABOUT&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;CATEGORIES&lt;/a&gt;
                          &lt;ul&gt;
                              &lt;li&gt;&lt;a href="#"&gt;Wordpress Themes&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#"&gt;Create Plugins&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#"&gt;Wordpress Themes&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a href="#"&gt;Create Plugins&lt;/a&gt;&lt;/li&gt;                         
                          &lt;/ul&gt;
                      &lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;BLOG&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="#"&gt;CONTACT&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;--&gt;
                  &lt;?php wp_nav_menu('menu=header_menu&amp;container=false&amp;menu_id='); ?&gt;
                  &lt;div class="clear"&gt;&lt;/div&gt;       &lt;/div&gt;&lt;!--//header_menu--&gt;
                          &lt;div class="clear"&gt;&lt;/div&gt; &lt;/div&gt;        &lt;div class="clear"&gt;&lt;/div&gt; &lt;div class="tagline"&gt;             &lt;?php echo get_option($shortname.'_header_text','Use Neue Theme Settings to update this text...') ?&gt;        &lt;/div&gt;&lt;!--//tagline--&gt;
              &lt;/div&gt;&lt;!--//header--&gt;
  </code></pre>