Forums

ListPages with li either side (6 posts)

  1. Tirwin
    Member
    Posted 1 year ago #

    Im using:

    <ul>
    <?php  wp_list_pages('title_li=&depth=1' ); ?>
    </ul>

    This outputs all pages I have published.

    I need this so that each link published has

    <li> </li>

    either side. I've seen the statement before but can't remember it.

    Can someone advise how I can use the statement above but have the li tag either side of each link published?

  2. Mark / t31os
    Moderator
    Posted 1 year ago #

    http://codex.wordpress.org/Function_Reference/wp_list_pages

    Are link_before and link_after what you're after? (see link above)

  3. Tirwin
    Member
    Posted 1 year ago #

    Possibly, I'll try. Would it just read like:

    <ul>
    <?php wp_list_pages('link_before=
    <li>&link_after=</li>
    &title_li=&depth=1' ); ?>
    </ul>

    Or would I have to quote the tags too? ie:

    <?php  wp_list_pages('link_before='
    <li>'&link_after='</li>
    '&title_li=&depth=1' ); ?>
  4. Tirwin
    Member
    Posted 1 year ago #

    ah... it removed the < li > from the code and went onto a new line instead

  5. Tirwin
    Member
    Posted 1 year ago #

    This resolved my issue, many thanks!

  6. Mark / t31os
    Moderator
    Posted 1 year ago #

    Glad to hear you figured it out and happy to have helped.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags