• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

The Cre8tive Diva - WordPress Developer

Digital Nomad | Helping WordPress & Genesis Framework Website Owners All Over the World

  • Home
  • About
    • Terms of Service & Privacy
    • Accessibility
  • Services
    • Blogger to WordPress Migration
    • Buddypress Installation
  • My Work
  • Blog
    • Tutorials
    • Five on Friday
    • Genesis Framework
    • Tipsy Tuesday
    • WordPress
  • Contact
Home » How to Display One Category on the Home Page of Digital Pro (and others)

How to Display One Category on the Home Page of Digital Pro (and others)

Note: This tutorial will also work on other Genesis Child themes that have the “Front Page Content Settings” such as the following: Refined Pro, Captivating, Sprinkle Pro, Market, Dazzling, Tickled Pink, Cultivate, and Simply Charming.

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.

If you are unfamiliar with working with your theme files, stop and ask for help. If you are familiar with modifying your theme files – you should back them up before proceeding.
// 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' );
view raw gistfile1.txt hosted with ❤ by GitHub

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.

[Source Reference]

  • Like my Signature? Get the Signature Widget for Genesis right here!

  • FacebookTweetPinPrintShares23

    Filed Under: Tutorials, WordPress

    A recent conflict was found when Genesis Simple Share is activated and configured while using the Posts and Page Grid in Genesis Blocks. The error can be seen when viewing the content on the front end. The error does not display in edit mode. Below is a temporary fix that will allow you to manually set […]

    Primary Sidebar

    It's just me and my dog Bella. I am a freelance web developer at Cre8tiveDiva.com. I build websites using WordPress and the Genesis Framework, WooCommerce and provide troubleshooting and support. I also build with Shopify. I love chocolate, lots of coffee!

    Sign Me Up!

    Receive my blog posts, tips and updates delivered to your inbox!

    Yes, Sign Me Up

    *By signing up you will receive new blogs, updates on products, services and important alerts.

    Categories

    • Design
    • eCommerce
    • Five on Friday
    • Fonts
    • Free Themes
    • Freebie Friday
    • Genesis Framework
    • Genesis Plugins
    • Genesis Themes
    • Genesis Untapped
    • Instagram
    • MailChimp
    • News
    • Plugins
    • Press This News
    • Social Media
    • Tipsy Tuesday
    • Troubleshooting
    • Tutorials
    • Uncategorized
    • Web Development
    • WooCommerce
    • WordPress
    • WordPress Plugins

    Footer

    Digital Nomad! I can be anywhere I wanna be now.

    Latest Blog Posts

    • Temporary Fix When Using Genesis Blocks Posts and Page Grid with Genesis Simple Share
    • How to Add Reading Time to a WordPress Genesis Child Theme Without a Plugin
    • How to Add “Shop” to WooCommerce Breadcrumbs when Using Yoast

    Looking for Something?

    Copyright © 2012–2022 · Designed with by Me! · Hosted on SiteGround

    We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy