Using the default wp_list_pages() is there an easy way / filter to add title attribute to the anchors? Right now it just spits out the anchor with no title attribute but I would like to add it on just as the page title or something:

<a href="http://www.url.com" title="Test Page">Test Page</a>

Now I know I can do this using a big nasty walker but I feel like that's many lines of code for such a small thing. Is there a simple way / easy way to add the Title Attribute to wp_list_pages() anchors? Think code-golf.

  • What would you put into that attribute? In your example, you are repeating the link text – this is terrible for screen reader users and the main reason why so many title attributes were removed in WordPress. – fuxia Sep 13 '14 at 9:33

No. Unfortunately you're looking at a walker, or a custom replacement function, as described here: https://stackoverflow.com/questions/12353076/wp-list-pages-isnt-showing-title-attribute

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.