WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Add title attribute in wp_list_pages

[Resolved] Add title attribute in wp_list_pages

  • virendra930
    Member

    @virendra930

    Hii ,
    I am using wp_list_pages( $args ) function in a template its working fine and the output is

    <a href="http://www.example.com/">Home</a>

    but I want to add title attribute also for example

    <a href="http://www.example.com/" title="Home">Home</a>

    Please help me out
    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • that should be doable by extending the walker class. Not sure about the exact code at the moment but there are many blogs describing the process.

    StackOverflow has a good solution.

    Basically wp_list_pages doesn’t have a title=”attribute” option, so you’d write your own function.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Add title attribute in wp_list_pages’ is closed to new replies.