#wordpress #widget_posts_args #WordpressFilter #wordpressCoding
In this video I am going to describe how we can use "widget_posts_args " wordpress filter and show posts from particular category only in wordpress widget.
you can be creative and add as many restrictions or rules as you want to get required output.
Here you will find list of all arguments
[ Ссылка ]
you can add if conditions to change behavior of plugin on different pages of your wordpress website.
/* filter recent posts widgets by category name
which args we can pass in this filter?
[ Ссылка ]
*/
function myorg_recentposts_events($args, $instance) {
$args['category_name'] = 'articles';
return $args;
}
add_filter('widget_posts_args', 'myorg_recentposts_events', 1, 2);
Ещё видео!