Reply To: Showing posts by category in sidebar

forums forums Circle Flip Support Showing posts by category in sidebar Reply To: Showing posts by category in sidebar


Omar
Keymaster
#3096

Hello Webbevakning,

Sorry for a terribly late response,

To display a specific category in the sidebar, you’ll have to apply a small edit to a file.
Navigate to wp-content/themes/circleflip/widgets/recent_post_widget.php

Edit the file recent_post_widget.php
find line: 59
Where

$args = array(
‘post_status’ => ‘publish’,
‘post_type’ => ‘post’,
‘order’ => ‘DESC’,
‘posts_per_page’ => (int) $latest_count,
);

Add to the array the category argument like so:

$args = array(
‘post_status’ => ‘publish’,
‘post_type’ => ‘post’,
‘order’ => ‘DESC’,
‘posts_per_page’ => (int) $latest_count,
‘category_name’ => ‘health’,
);

Of course you will have to replace the category name ‘health’ with your selected category’s slug.