Pages

Search This Blog

Use the “Pages” Sidebar Section as Your Main Navigation


While I’ve already discussed a little bit about the sidebar, it’s worth mentioning separately that the “pages” section of the sidebar can easily serve as your main navigation bar. At first glance, nobody will even notice that this has been done.
In the default WP theme, here’s the code that generates the “pages” section of the sidebar, found in sidebar.php:
  1. <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>  
Simply take that piece of code and place it wherever you want your main navigation to display. Of course, you’ll have to style it to your liking, in line with your theme’s look. And most likely you’ll want to remove the title of that section. You can do that by simply removing everything after the equals sign in the single parameter, so it will look like this:
  1. <?php wp_list_pages('title_li=' ); ?>  
Use the WordPress Codex to see other ways to customize the look of the page list in the default wordpress theme.

No comments:

Post a Comment

Related Posts Plugin for Blogger...
 

Blog Archive