User main sidebar for posts and pages
-
This is not a request for support. It’s just my experience that I want to share for who encountered the same problem and it may be a suggestion for theme author to add this feature to theme setting, such as: [Use Main sidebar only, etc.]. Below is how I have got it done.
By default, Justwrite theme uses 2 sidebar:
– Posts sidebar for single posts and pages
– Main sidebar for the rest
When building up my site, I realized that I don’t need posts sidebar but just user Main sidebar for everything. I looked up for the theme documentation and googling about it but did not figure out anything related. Then I decided to solve it myself.
I opened the file \\htdocs\wp\wp-content\themes\justwrite\sidebar.php and copy the code:
dynamic_sidebar( 'main-sidebar' );
then open the file \\htdocs\wp\wp-content\themes\justwrite\sidebar-posts.php, commentized the line:
else { echo '<p class="add-some-widgets">' . __( 'Add some widgets! (Posts Sidebar)', 'acosmin' ) . '</p>'; }
and paste the code in clipboard right under it. New sidebar-posts.php’s code will look like:
<?php if ( is_active_sidebar( 'posts-sidebar' ) ) { dynamic_sidebar( 'posts-sidebar' ); }
//else { echo '<p class="add-some-widgets">' . __( 'Add some widgets! (Posts Sidebar)', 'acosmin' ) . '</p>'; }
else { dynamic_sidebar( 'main-sidebar' ); }
?><!-- END Sidebar Widgets -->
Saved and closed both files and refresh the homepage and some post, I found that my problem has been solved.
Just want to share for everyone. Any comment or other solution suggested to me will be appreciate!
- The topic ‘User main sidebar for posts and pages’ is closed to new replies.