WordPress.org

Forums

[resolved] Add title attribute in wp_list_pages (3 posts)

  1. virendra930
    Member
    Posted 1 year ago #

    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!

  2. gerald@WPcustoms
    Member
    Posted 1 year ago #

    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.

  3. Gwyn
    Member
    Posted 1 year ago #

    StackOverflow has a good solution.

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

Topic Closed

This topic has been closed to new replies.

About this Topic