How to add navigation to your sidebar in WordPress
The sidebar of a website is traditionally used to place navigation links for visitors to find their way around a website. In Wordpress, there are three basic navigation types: Pages, Archives, and Categories. You may add these to your sidebar to help your visitors be able to find content on your site more easily. You can modify your sidebar file to add navigation to these content types. Below are the instructions on how to modify your sidebar to add navigation to your WordPress site.
- Log into your Wordpress Admin dashboard.
- Once logged into the Admin area, look to the left hand menu and click on the Appearance menu category. This will reveal several sub-options. Click on the Editor option to continue.
- You are now on the main Editor page for all php and css files for your theme. Look to the menu on the right-hand side, scroll down until you see the Sidebar option. Click on that link to open the sidebar.php file in the editor.
- Once the file opens you will see the php code that governs the sidebar display and behavior. From here you will be able to add the code to populate the sidebar with navigation links for Pages, Categories, or Archives. Below are the code samples you would need to add to your sidebar.php file
<?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>
<?php _e('Categories:'); ?> <ul> <?php wp_list_cats(); ?> </ul>
<?php _e('Archives:'); ?> <ul> <?php wp_get_archives('type=monthly'); ?> </ul>
- Insert your code into the appropriate spot in the file editor. After inserting the code, click on the Update File link to save you code. From there you can visit your site to see the additional navigation links you have added. You are able to adjust the formatting (font, etc) by adding inline custom CSS or adjusting your style.css file.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
new! - Enter your name and email address above and we will post your feedback in the comments on this page!
Post a Comment
News / Announcements
Customizing your Wordpress Sidebar
|1.||Adding Nested Links to your sidebar in Wordpress|
|2.||How to add navigation to your sidebar in WordPress|
|3.||Adding Meta Data to your WordPress sidebar|
|4.||How to add images and image links to your WordPress sidebar|