WordPress.org

Ready to get started?Download WordPress

Forums

automatically add character after link (4 posts)

  1. csleh
    Member
    Posted 6 years ago #

    I'm trying to add a >> using » after links using a list_pages function, but every place I try breaks the site.

    Am showing the list of children only if there are children. Adding the » after echo children puts the character after the last link, but is not a link itself. I would like the character to be part of each link.

    This is what I'm using:

    <?php
    if($post->post_parent)        /* section navigation */
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    <ul class="subnav">
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    Thank you!

  2. Joni
    Member
    Posted 6 years ago #

    If each link is a list element, then can't you slap it all in a #div and style it using the pseudo-class :after?
    http://www.topxml.com/css/css_pseudo_element_after.asp

  3. csleh
    Member
    Posted 6 years ago #

    yes, but I was hoping for something to add to the code so that IE users would see it.

    I've read in the codex that some tags allow for outputing a character before or after, but I'm not sure where I could add that to the above -- when I try the whole site goes white screen.

  4. csleh
    Member
    Posted 6 years ago #

    I'm pretty sure this is a php/code question. If I can't add a character automatically to the list in the code above, is there some other bit of code that will generate a character after a link?

    I've been searching but am not finding any info -- looking for "add character" "add text" with automatic, link, wordpress, php etc in google. Looking for an option like "nextlabel" or something.

    Perhaps I'm phrasing incorrectly -- if you know better search terms please share!

Topic Closed

This topic has been closed to new replies.

About this Topic