WordPress.org

Ready to get started?Download WordPress

Forums

Add title attribute in wp_list_pages (3 posts)

  1. virendra930
    Member
    Posted 5 months 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 5 months 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 5 months ago #

    StackOverflow has a good solution.

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

Reply

You must log in to post.

About this Topic