Widget Login Plug-in using 'widget_content' filter and tags
-
I would like to use the standard Recent Posts widget and widget logic to show only recent posts that have been tagged with either “news” or “blog”. ‘
I think that I need to check the box at the bottom of the widget page to allow me to filter ‘widget_content’. I then understand that I need to add a line similar to the following to functions.php
add_filter(‘widget_content’, ‘tag_filter’, [priority], 2);
… I then am supposed to create a function to show what I would like which is where I get stuck. It would be something like the following maybe?
function tag_filter($content=’has_tag(‘news’)’, $widget_id=’2′)
The desired effect would be a recent post widget that is showing the most recent post that are tagged with the “news”.
Am I close?
Thanks for the help!
- The topic ‘Widget Login Plug-in using 'widget_content' filter and tags’ is closed to new replies.