Tweaking “wp_list_pages” & “wp_list_cats” output
-
Hi,
does anyone know how to teak the “wp_list_pages” output to include an “after” parameter (without hacking the WP install, directly). I have a list output from “wp_list_pages”, and I have my css creating a horizontal menu, here is the current output:
<li class="page_item"><a href="/biography/" title="Bio">Biography</a></li>
<li class="page_item"><a href="/contact/" title="Contact">Contact</a></li>
<li class="page_item"><a href="/links/" title="Links">Links</a></li>
<li class="page_item"><a href="/search/" title="Search">Search</a></li>
producing what looks like this:Bio Contact Links Search
Since the menu is horizontal, I’d like to add a comma at the end of each link in the menu. But I can’t (for the life of me) figure out how to add the end comma. This is what I’d like the output to look like:
<li class="page_item"><a href="/biography/" title="Bio">Biography</a>,</li>
<li class="page_item"><a href="/contact/" title="Contact">Contact</a>,</li>
<li class="page_item"><a href="/links/" title="Links">Links</a>,</li>
<li class="page_item"><a href="/search/" title="Search">Search</a>,</li>
producing what looks like this:Bio, News, Links, Search,
It looks to me as if the only way to do this is to add the commas using the “li” selector to add the comma as generated content in the css. but this presents a problem in certain browsers. I’d like avoid using generated content and to avoid hacking my WP install.
any takers?
bones points for anyone who can do the exact same for the “wp_list_cats” output
- The topic ‘Tweaking “wp_list_pages” & “wp_list_cats” output’ is closed to new replies.