New WordPress Plugin – Page Menu Editor

I’ve been improving my old Custom Page Title Attributes plugin, and have effectively added to the flexibility this can give by adding an additional text field to allow you to easily change the anchor text (menu label) of the page in the wp_list_pages() output. Okay, that sounded quite technical…!

Basically (I say that word far too much!), by default WordPress offers you two text fields for a static Page (note the capital P for a WordPress Page) – Title and Post. Ignore Post, we know what that does. The Title field supplies content for the page title (wp_title()), page header (the_title()), the anchor text in the menu (menu label) and the title attribute of the page link in the menu (these last two are generated by wp_list_pages()). That’s the same content 4 times, and not always appropriate!

Let’s look at WordPress for a CMS point of view. We have the front page. We want a nice long 75 character page title to help with our SEO. We’ve got the All in One SEO pack or the SEO Title tag plugins for that job – great! Okay, we want a slightly shorter but just as meaty header. However we only have about 100 pixels for the menu label and let’s face it ‘Home’ is usually the best choice. However, we don’t want ‘Home’ as the header. So up until now, to combat this, I’ve removed the_title() from theme files and used the title field for the menu label and hardcoded the title into the content area (ie. put the title into a h2 within the content field).

That’s fine for me, and anyone who knows what a h2 is, but let’s face it, most clients don’t and it’s really not a good idea to try and explain them! So to get around this I figured that I could just use the same idea for replacing the anchor text as I already had for the title attribute, a couple of hours (and fun and games with pattern matching) later, I managed to get the new plugin working.

So, without further ado or rambling from me, feel free to go grab my latest plugin – Page Menu Editor and let me know what you think πŸ™‚

You may also like...

6 Responses

  1. Abel says:

    For someone like me who have a lot of WordPress CMS projects, this plugin is a gem. I used to do create a separate page template just to make it appear a page has a different page title to the one appearing on the menu generated by wp_list_pages.

    The ability to edit the title attribute for the link is a real bonus! πŸ™‚ Thanks!

  2. Sarah says:

    Abel, I know how you feel. It was something I’ve been intending to do since I did the custom title attributes plugin last year, it’s just been finding the time! Glad it’s of help πŸ™‚

  3. Luke says:

    I love this plugin as well, it works great!
    I would like to know if you have ever thought of doing the same thing for post or adding the ability for this plugin to work with post as well.
    It would be a great option!

    • Sarah says:

      Hi Luke, it’s not hard to convert for posts but I really don’t see the point. Posts do not have a natural navigation in your sidebar unless you use the Recent Posts method, and even then they’ll drop off the list quite quickly (besides mine!).

  4. dydi nadya says:

    hi sarah,
    i would like to know, is ur plugin allow me to add image or icon before the Page title? if yes, then i definitely will use this great plugin.if no, do u have any suggestion so that i can do what i my project require?
    thanks alot sarah.

  5. Sarah says:

    The plugin just allows you to set the menu label and title attribute text. If you want to add a specific image or icon next to each page link then personally I would use CSS as it’s design not content. The list item for each page link has an ID on it and you can target that, by setting the background image on each list item to be your image/icon.

Leave a Reply

Your email address will not be published. Required fields are marked *