Extending The Fold Page Menus Wordpress Plugin
I decided to implement the Fold Page Menus plugin for Wordpress on my site to allow me to give users a deeper navigational display than I previously had. It worked great, but with one problem, and I’d like to share my solution with the community.
The problem with Fold Page Menus
The issue was that there is no link to the blog home utilizing this as your sole navigational element. Though I could have simpley placed a new list item with the link to “blog” in the code, it doesn’t allow me to style it differently depending on the status of the page, like the plugin does for other pages (by giving it a current item class).
Since I wanted to take advantage of this feature to provide a better user experience, clueing them into how the navigation of the site works, and giving them their current bearings at a glance, I decided to tinker.
The solution
The tinkering didn’t last long at all. All I had to do was create the following code in my sidebar.php file:
<ul>
<li class=”page_item<?php if(!is_page()){ ?> current_page_item< ?php } ?>”><a href=”http://www.northlander.org”>Blog</a></li>
< ?php wp_list_pages(fold_page_menus().’sort_column=menu_order&title_li=’); ?>
</ul>
In short, I just added my blog list item before the function call, but I took advantage of the wordpress conditional formatting is_page() function by simply inverting it to !is_page(). So, now every non-page page in Wordpress is given the blog identity in the navigation and is open for styling with CSS.
You can leave a response, or trackback from your own site.
the shirts from 