|
All about the system administration and application development behind a local linux-based company
I’d like to be able to include links that are not pages in my pages menu, as most themes display the pages menu as the main navigation bar for the site. The general wisdom has been to hard-code those links into the theme, however I want to be able to intersperse links
with pages, and I want to be able to switch themes without patching all of the themes I use.
I accomplished this with a plugin that takes an array of html to insert at points in the pages menu. For example, in my blog I have a link for “computers” and a link for “other thoughts”, which are before any of the real pages are displayed. The configuration line of my plugin looks like the following:
//An array of items to insert. 0 makes it the first link, 2 makes the link appear after link 2, etc.$insert_array = array (0 => '<li><a href="http://erek.blumenthals.com/blog/category/linux" title="linux">Computers</a></li>',1 => '<li><a href="http://erek.blumenthals.com/blog/category/other" title="other">Other Thoughts</a></li>'To install this in your blog: download the file, customize the insert array with the links you’d like to add, drop the php file in your wp-content/plugins folder, and activate the plugin. Please drop me a line if you decide to use it, as I’m curious what people will do with it. Also feel free to shoot suggestions my way for improvements.
December 24th, 2007 at 7:50 am
looks nice, i might give it a go one of these days
January 27th, 2008 at 4:11 pm
Thanks for this plugin. I’ll be using it on a band site I’m making. (no linky yet)
April 9th, 2008 at 5:56 pm
Thanks for doing this. This is exactly what I needed and did not want to go into the code to do it.