Digital Pro has a setting that allows you to display your most recent Journal (Blog) entries on the home page. This setting appears under Appearance -> Customize -> Front Page Content Settings.
If you would like to display one category on the home page, simply copy/paste the following code into the functions.php file of your child theme, or if you use a custom function file, save it there.
// Display one category on the home page | |
function c8d_display_one_category_home( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$query->set( 'cat', 'ENTER YOUR CATEGORY ID NUMBER HERE' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'c8d_display_one_category_home' ); |
First, locate the category ID number of the category you wish to display on the home page. The easiest way, in my opinion, to find your ID is to install/activate the Reveal IDs plugin. This will place a column in the dashboard with the ID numbers on your pages, posts, categories, tags, and more.
Locate the ID and enter that number on Line 4 where it says “ENTER YOUR CATEGORY ID NUMBER HERE.” Only replace the words in between the beginning (‘) and ending (‘) or you may get the white screen.
Save the file. If you have a caching plugin installed, clear your cache and you should only see content from the one category on the home page.