tiresias53
Member
Posted 3 years ago #
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 '&:' and '&' but no joy.
Does anyone know what I'm doing wrong?
Nosferke
Member
Posted 3 years ago #
You already tried & #38; ?
tiresias53
Member
Posted 3 years ago #
Thanks for the suggestion. I've tried that and still no joy.
I've also tried surrounding '&' and '&' and '&' in single and double quotes but nothing seems to work.
tiresias53
Member
Posted 3 years ago #
Oops! Forgot to use the code button. That should be: I've also tried surrounding
&amp; and & in single and double quotes but nothing seems to work
As a workaround, how about:
<h3>Prices & Places</h3>
<ul><?php wp_list_pages('title_li='); ?></ul>
- Tim
tiresias53
Member
Posted 3 years ago #
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.