Plus sign in wp_list_pages (3 posts)

  1. Stef Verbeeck
    Posted 4 years ago #

    Hi all,

    Using the code below, I'm trying to add a css-styled "+" in front of my menu items:

    <?php wp_list_pages('title_li=&child_of=989&link_before=<span class="sideplus">+</span>'); ?>

    On my page, the plus won't show up. It is visible however in a regular "ul" without the use of the template tag.

    Is there a way (other than using a "\" or the ascii-version, which don't work) to show this +? Other characters like a minus or a letter show up just fine.


  2. esmi
    Forum Moderator
    Posted 4 years ago #

    It would be far better if you used CSS for this. Perhaps using the pseudo :before selector on the li. Or simply as a list background image.

  3. Stef Verbeeck
    Posted 4 years ago #

    Fixed it after all.

    The trick is in replacing the + with it's PHP equivalent "%2B" as such:

    <?php wp_list_pages('title_li=&child_of=987&link_before=<span class="sideplus">%2B</span>'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic