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 🙂