Hi, you can use Moesia: Recent Posts and change theme folder > widgets > recent-posts.php, this line:
$r = new WP_Query( apply_filters( 'widget_posts_args', array(
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
) ) );
to this:
$r = new WP_Query( apply_filters( 'widget_posts_args', array(
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'ignore_sticky_posts' => true,
'category_name' => 'landscapes, uncategorized'
) ) );
This is what is added just specify your categories separated by comma or specify just one category.
'category_name' => 'landscapes, uncategorized'
Also consider using child theme since changes will be lost on next theme update.
Best regards
Is there a way to do this with css? I don’t use a child theme and try not to modify theme files.
Hi, no it is not possible, css is only for styling.
Best regards