How to add navigation to your sidebar in WordPress
Written by Scott MitchellThe 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
Pages
<?php wp_list_pages('title_li=<h2>Pages</h2>'); ?>
Categories
<?php _e('Categories:'); ?> <ul> <?php wp_list_cats(); ?> </ul>
Archives
<?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.
Like this Article?
Tweet
Customizing your Wordpress Sidebar
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |

