tags:

views:

30

answers:

0

When calling WP's wp_list_pages() function, the script builds an unordered list menu and automatically ads a "current_page_item" class to the li element that we are currently viewing (if applicable).

I'm trying to get the "Recent Posts" widget to do the same, but I'm unsure how to do it, because I can't find a reference for this argument in the docs.

Here's the code...

<?php the_widget('WP_Widget_Recent_Posts', 'title=My Recent Posts&number=5', 'before_widget=<div class="recent">&after_widget=</div>&before_title=<h4>&after_title=</h4>'); ?> 

This bit of code inserts to the WP default "Recent Posts" widget into my theme and passes it the two "instance" settings that it accepts (title and number of posts) as well as the "arguments" that it accepts (before_widget, after_widget, before_title, after_title).

The only thing I'm missing from the output is...

<li class="current_page_item"><a href="">Current Page</a></li>