Add WordPress Menu Description

So I have been thinking about a blog redesign for a little while. I am not really happy with the current design so I have been keeping my eye on things that I like and how I can incorporate it into my design.

One of the things that has been catching my eye was the descriptive text in the WordPress menus of some sites. Some examples can be see in WooThemes in both the free BlogTheme and the commercial offering f0101 & Busy Bee. I also noticed Grid Focus a free WordPress theme that has the effect that I was looking for. The biggest thing that I noticed was they rewrote the wp_page_menu() function. Some of them rewrote the dynamic classes but missed a few(WooThemes). I knew there had to be a better way so I kept searching. I ran across ThemeShaper and the post WordPress Menu Tricks and it looks like John Kristian took this a giant step further to include options to add categories and drop down menus and more flexibility with his post A Smarter Menu for WordPress BUT these solutions required an additional function to be added to the WordPress template.

I knew there had to be a simpler way. Since we are using php in WordPress why can’t I rewrite the code as it is being generated by wp_page_menu()? There is a PHP function for just this called str_replace() that seemed like it would do exactly what I was looking for. Since I am not a programmer the next step was to look for aWordpress plug-in that used this function in some way. Just to get a hint as to how to do it. My searching came to Page Lists Plus a very well written plug-in that comes VERY close to what I wanted to so. You can read the description below.

Adds customization options to the wp_list_pages function which is used to create Page menus. Change the link text and title attributes, redirect, nofollow or unlink links, and remove links from page lists altogether, all through the WordPress dashboard.

So I hacked it ;-) and now I would like to make it available in a stripped down form.

This little plug-in will add a text field under your post, this is where you would add in your menu description text. 

If all goes well this should be your result. 

You must log in to access this file.
To download this file you must right click and select Save As

Log in

Download: Add Wordpress Menu Description (58)

To install this plug-in simply unzip the down loadable file into your plug-ins directory and activate

I would love to hear comments.

Popularity: 53% [?]

Comments

  1. This is exactly what I’ve been searching hours for today.
    I installed it, it added the text BUT it also returned a couple of warnings related to files in the WP core. I would include a link here to show you but I had to un-install this on a live site. Any incite on the following warnings?

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘page_exclusions’ was given in /home/content/97/5106297/html/wp-includes/plugin.php on line 166

    Warning: implode() [function.implode]: Invalid arguments passed in /home/content/97/5106297/html/wp-includes/post-template.php on line 761

    Thanks!
    dbone

  2. David says:

    Hello

    It looks like it may be conflicting with another plug-in. Try deactivating your other plug-ins to see if the error goes away.

    Dave

  3. wizeazz says:

    Thanks.
    will give a try in combination with pixopoint.

  4. jetonr says:

    Hi there,
    I really like this is idea is much easier than other plugins and it allows current_page_item right? Meaning i can add css to active menu.
    I wanna download it but the link is not working ????

  5. miracleman12 says:

    Thank you for this. What I did was take the code that you wrote (or some of it) and reintroduced it to Page List Plus because I need some of the other functions of Page List Plus. The two combined was exactly what I needed. Thank you for pointing me in the right direction!

  6. David says:

    @miracleman12
    Your very welcome and thank you for your kind words. I actually did the same thing and have the complete plugin but I wanted some feedback from the original author before I offered it to the public.

    Dave

  7. mtjader says:

    I think some of the problems that people are complaining about stem from at the top of the plugin line 39
    add_filter( ‘ wp_list_pages_excludes ‘ , ‘ page_exclusions ‘ ); this page _exclusion is not in your plugin

    Thanks for all of your work

Trackbacks

  1. [...] This post was mentioned on Twitter by TJ Baker, thetemplateblog. thetemplateblog said: Add WordPress Menu Description with a simple plug-in http://tinyurl.com/ycd4xl9 Please RT [...]

Speak Your Mind