I am trying to list posts belonging only to a certain category on the default wordpress blog page. I need to do this by adding a filter/action hook via a plugin. I can not edit the theme template files.
I have done this for recent posts listing using the following code:
add_filter('widget_posts_args', 'my_widget_posts_args');
function my_widget_posts_args($args) {
return array( 'posts_per_page' => 10,//set the number you want here
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'cat' => 52 //$cat -> term_id//the current category id
);
}
How do I do the same for the post listing page?