• martflngn

    (@martflngn)


    Hi
    I want to remove the Sidebar Widget in one or two pages and how do you it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author tishonator

    (@tishonator)

    Hi martflngn,

    this can be done by using a custom page template. Here are the necessary steps:

    1. Copy the below code and save it as a php file in fbiz theme folder (i.e. filename no-sidebar-page.php)

    <?php
    /*
    
    Template Name: No Sidebar Page
    
    */
    
     get_header(); ?>
    
    <?php fbiz_show_page_header_section(); ?>
    
    <div class="clear">
    </div><!-- .clear -->
    
    <div id="main-content-wrapper">
    
    	<div id="main-content" style="width:95%;">
    
    		<?php if ( have_posts() ) :
    
    					while ( have_posts() ) :
    
    						the_post();
    
    						// includes the single page content templata here
    						get_template_part( 'content', 'page' );
    
    						// if comments are open or there's at least one comment, load up the comment template.
    						if ( comments_open() || get_comments_number() ) {
    							comments_template();
    						}
    
    					endwhile; // end of have_posts()
    
    					wp_link_pages( array(
    									'link_before'      => '<li>',
    									'link_after'       => '</li>',
    								 ) );
    
    		      else : 
    
    					// if no content is loaded, show the 'no found' template
    					get_template_part( 'content', 'none' );
    
    			  endif; // end of have_posts()
    			  ?>
    
    	</div><!-- #main-content -->
    
    </div><!-- #main-content-wrapper -->
    
    <?php get_footer(); ?>

    2. Upload the above file to your wordpress theme onto your site (path: /wp-content/themes/fbiz)

    3) In WordPress Admin, open a page you want to modify. From right menu, below ‘Template’ choose ‘No Sidebar Page’.

    4) On same page, click on ‘Update’ Button.

    5) Open page URL. It should be displayed using the newly defined template without sidebar, instead of the default one.

    I hope the above helps 🙂

    [ Signature moderated ]

    Otje

    (@otje)

    Thanks Thisonator! I was also looking for a solution to this problem as well. It took me a while to follow your instructions, but it worked. Thanks!

    I have another question as well. When you click on a page, the page name remains highlighted on the top right hand side. I like that feature. But because it remains highlighted, there is no need to also display the page title on the screen in my view. Is there a way to to do this? I tried the ‘disable title’ plugin but that does not seem to work. Can you please help. Thanks again,

    Otto

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Sidebar Widget Area’ is closed to new replies.