I have my own “Recent Posts” menu, but its not currently implemented as a Widget. I’m just including it in sidebar.php.
I had to “roll my own” so to speak in order to filter the menu of certain categories whose posts I don’t want to appear in the menu.
Would it be possible, via functions.php, to filter the default “Recent Posts: widget’s menu items in order to exclude posts belonging to a specific category?
If so, I’d really be grateful for an example.
Unfortunately there is no filter for
WP_Query
args inWP_Widget_Recent_Posts
class, so it’s impossible. I think there are plugins for recent post that have category filtering option – http://wordpress.org/extend/plugins/tags/recent-postsSince WordPress 3.4.0, it’s possible to filter the argument to the query.
More info class-wp-widget-recent-posts.php