WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove title attribute from wp_list_pages() (5 posts)

  1. Matt
    Member
    Posted 5 years ago #

    How can I remove title attribute from wp_list_pages()?

    Example

    <li class="page_item page-item-28"><a href="/wp/?page_id=28" title="Europe">Europe</a></li>

    becomes

    <li class="page_item page-item-28"><a href="/wp/?page_id=28">Europe</a></li>

    Why? The client wants it that way. Shrug.

  2. Ivovic
    Member
    Posted 5 years ago #

    well, I hate useless tooltips on links too, so I kind of understand - but I think this would be something that requires hacking core code, and I don't really advocate that for something this trivial, as it will need to be redone for each upgrade.

  3. haochi
    Member
    Posted 5 years ago #

    It's in wp-includes/classes.php if you (your client) still want it.

    Find
    <a href="' . get_page_link($page->ID) . '" title="' . attribute_escape(apply_filters('the_title', $page->post_title)) . '">'

  4. chrisbirchall
    Member
    Posted 5 years ago #

    Nice one Haochi.

    If I were to set up a custom field (called, say: "label") how would I edit the code above to show the "value" of that field as a tooltip?

    Chris (UK)

  5. sammyb
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic