• Resolved RobertJRichey

    (@robertjrichey)


    I have the main (home) page on my website setup as the location to add posts. I would like that main page to have the sidebar as currently shown, but subsequent pages to not include the sidebar. This would include the page that contains the actual post when you click the ‘read more’ link (I don’t want the sidebar there, either).

    Is there a way to do this and have the content and images on the non-sidebar pages fill the pages?

    My site is https://www.robertjrichey.com.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter RobertJRichey

    (@robertjrichey)

    I think I’m getting close. I created a static homepage, then disabled the sidebar on all of the other pages. But there does not seem to be a way to disable the sidebar on the Posts page. Any suggestions are much appreciated!

    Hi RobertJRichey

    You don’t to disable sidebar on all of other page for your issue.
    Your issue can be solved by creating and customizing child theme.
    After creating and activating child theme copy and paste sidebar.php file from main theme to child theme folder.
    Now edit sidebar.php as shown below in child theme’s folder.

    <?php if ( is_active_sidebar( 'sidebar' ) ) : ?>
    
    		<?php
    		if(is_front_page()){?>
    			<div class="sidebar right" role="complementary">
    				<?php
    					dynamic_sidebar( 'sidebar' );
    				}?>
    
    			</div><!-- /sidebar -->
    
    <?php endif; ?>

    Note: Please customize files of child theme, so your changes will not overwrite on theme update.
    Hope this will solve your issue.

    Best Regards!!!

    Thread Starter RobertJRichey

    (@robertjrichey)

    Thanks! I created a child theme and copied sidebar.php, making the suggested changes. It all worked perfectly!

    I really appreciate your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Sidebar’ is closed to new replies.