August 2017
Beginner
412 pages
10h 30m
English
There is just one more essential template file to create. For this one, cut out the entire div element containing your sidebar. In my case, it's the following text:
<div id="secondary" class="widget-area" role="complementary"> <?php if(is_active_sidebar('sidebar-1')) dynamic_sidebar('sidebar-1' ); ?></div>
Paste this text into a new file in your theme folder named sidebar.php.
Now, in index.php, add this function in the place you just cut your sidebar from:
<?php get_sidebar(); ?>
This will include the sidebar. In the case of my design, I want the sidebar on every page. So, it's not crucial for it to be a separate file. I could have included it in the footer.php file. However, in some templates, including the default ...
Read now
Unlock full access