Yes, I've been busy again and have created my second (well second released) WordPress Plugin. Custom Title Attributes allow you to change the title attribute of page links displayed using the wp_list_pages() template tag in WordPress.

I created this for use on the various sites we have running WordPress as a CMS. I noticed about 6 months ago that the title attributes used on the Page links contained identical text to the anchor text – a waste of time in my opinion. I only add a title attribute if I think it's needed, which at times it is. After searching high and low I couldn't find anything that did this, so after a bit of studying of the Plugin Codex I realised that there was a way to do it. After a lot of learning of Pattern Syntax I finally cracked it.

It's a pretty simple plugin that just gives you an extra field (custom field actually, but I've put it below the content area) to complete when you add or edit a page to your site. It's not CMS specific as a lot of blogs have additional pages and this will kill off any duplicate title attribute unless you add in your own custom one.

I've tested it on a few sites including sites with and without permalinks, and sites with sub pages as well as top level. It's seemed fine but if you give it a go and find an issue please let me know on the plugin page :)

Custom Title Attributes

Trackback URL for this post: http://www.stuffbysarah.net/2007/11/05/new-wordpress-plugin-custom-title-attributes/trackback/
  • That's a cool plugin Sarah. The wp_list_pages function has always been a little limited to me. I get around it by just forgetting about it all together and entering the links manually.

    Keeping everything inside WordPress, your way, is probably a lot handier! xD

  • Sarah Comments:

    Using the page list is certainly handier when you allow clients to add extra pages, or have someone maintaining the site who doesn't know any HTML ;)

    I've found a plugin that allows you to easily exclude pages from the wp_list_pages() output as well so theoretically no code needs touching with these two plugins in use :)

  • lol – That's true. No doubt they will appreciate it. :D

  • Sarah Comments:

    It just means more control for them and less need for dependency on us. Which is always a good thing ;)

  • Durkin Comments:

    Handy plugin, thanks. It was annoying me how i had to have the same title for every page so this was exactly what i needed :)

  • Sarah Comments:

    Hi Durkin, glad to have helped :) Cheers for letting me know.

  • Lisa Comments:

    Thank you! Exactly what I was looking for to use in my website redesign!

  • Sarah Comments:

    Glad to have helped Lisa :)

  • Leave a Reply

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

    *

    Latest Tweets

    • Had a busy day but feel like I've tied up a lot of loose ends of work, plus getting the ball rolling on a new job. Fun month ahead! 6 hrs ago
    • Gorgeous but cold day out there. Nappies already out on the line getting plenty of sun. Shame I have to work, great photo ops out there 19 hrs ago
    • I've just increased my Dropbox space by over 3GB for free by syncing the photos off my phone. So easy :-) 1 day ago
    • More updates...