WordPress.org

Ready to get started?Download WordPress

Forums

add an extra html tag to wordpress list pages statement (2 posts)

  1. checksum
    Member
    Posted 8 years ago #

    With the wordpress list pages statement:

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>

    Is there any way to add a <span> tag before and after the link? Or any other way I could do this?

    Eg:

    <li class="page_item current_page_item"><a href="#" title="home"><span>home</span></a></li>
    <li class="page_item"><a href="#" title="about"><span>about</span></a></li>
    <li class="page_item"><a href="#" title="contact"><span>contact</span></a></li>

    Thanks...

  2. checksum
    Member
    Posted 8 years ago #

    I've sorted this:

    $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_page_link($page_id) . '" title="' . wp_specialchars($title) . '"><span>' . $title . '</span></a>';

    wp-includes/template-functions-post.php

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags