![]() |
|
12.14.09 Adding Submenus To Your Wordpress Blog By Alister Cameron If you're using WordPress as a CMS, you may have set up static pages for both a front page (e.g. "Home") and a page to list your latest blog posts (e.g. "Blog"). I did that today for a client site and immediately realized that in the site's main menu the Blog link would look a lot better if it had a submenu containing all the blog categories. (I didn't want nor did I need a completely separate category menu.) So I threw together this little bit of code that takes care of just that: (click to enlarge) ![]() For you programmers out there, this is just a slightly intelligent way to inject the output of wp_list_categories() into the output of wp_list_pages(), at the right place. If looking at code scares you I've turned it into a plugin. Go to the Admin > Plugins > Add New page in your WordPress installation and search for "add categories to menu", or download it here (give that file a .php extension instead of .txt and upload it). As soon as I have a live site sporting this plugin, I'll update this post with a link, so you can see a live demo. I'm likely to update this shortly with a configuration page so you can specify categories to exclude, and so forth. Comment below if you urgently need that. Comments About the Author: Alister Cameron is an accomplished web designer and internet marketing consultant who turns established subject-matter experts into expert bloggers. Alister's clients are using blogging and social media to leverage their offline expertise in the online world, and engage Alister to build their blogging platform or social network; to train them in writing and online marketing strategy; and to help them stay up with the latest developments in blogging and online marketing. Alister's blog is a rich tapestry of advice, anecdotes and reflections from the frontline of professional blogging, social media and search engine marketing, and never without generous dollops of humor and wit. |
||||||
|
|
|
-- DevWebProBR is an iEntry, Inc. publication -- iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 © 2009 iEntry Inc. All Rights Reserved Privacy Policy Legal
|