wp_list_pages Current page class
-
Hi all,
I am generating WordPress’ list menu with the following code:
<?php wp_list_pages('title_li='); ?>Which is producing the following html:
<li class="page_item page-item-2"><a href="#" title="Home">Home</a></li> <li class="page_item page-item-3"><a href="#" title="About Us">About Us</a></li> <li class="page_item page-item-5"><a href="#" title="News">News</a></li> <li class="page_item page-item-4"><a href="#" title="Services">Services</a></li> <li class="page_item page-item-6"><a href="#" title="Links">Links</a></li> <li class="page_item page-item-7"><a href="#" title="Contact Us">Contact Us</a></li>My question is: Should there be a classed list item that for the current page’s link by default? (i.e. if I was on the home page the home li would have the class current).
I need to style the current page’s li, how can I do this? Also if anyone happens to know it also, how can I style the last item in my menu list?
Thanks in Advance,
James
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘wp_list_pages Current page class’ is closed to new replies.