• Resolved tiresias53

    (@tiresias53)


    Does anyone know how I can get the title_li argument in wp_list_pages to return an ampersand?

    wp_list_pages ('title_li=<h3>'._('prices and places').'</h3>&child_of='.$post->ID);

    works but

    wp_list_pages ('title_li=<h3>'._('prices & places').'</h3>&child_of='.$post->ID);

    breaks. I’ve tried replacing the ‘&’ with ‘&amp:’ and ‘&amp;’ but no joy.

    Does anyone know what I’m doing wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • nosferke

    (@nosferke)

    You already tried & #38; ?

    Thread Starter tiresias53

    (@tiresias53)

    Thanks for the suggestion. I’ve tried that and still no joy.

    I’ve also tried surrounding ‘&’ and ‘&amp;’ and ‘&’ in single and double quotes but nothing seems to work.

    Thread Starter tiresias53

    (@tiresias53)

    Oops! Forgot to use the code button. That should be: I’ve also tried surrounding
    &amp;amp; and & in single and double quotes but nothing seems to work

    Technokinetics

    (@technokinetics)

    As a workaround, how about:

    <h3>Prices &amp; Places</h3>
    <ul><?php wp_list_pages('title_li='); ?></ul>

    – Tim

    Thread Starter tiresias53

    (@tiresias53)

    Hmmm. I was working on the same sort of workaround but found it stripped out the “pagenav” li class.

    So I ended up with

    ?><li class="pagenav"><h3>Prices & Places</h3><ul><?php
    wp_list_pages ('title_li=&child_of='.$post->ID);
    ?></ul></li><?php

    which works but is inelegant, to say the least. I should have thought there was a cleaner way to do it.

    Anyway, thanks for the ideas.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘title_li and ampersand’ is closed to new replies.