Many child themes now provide home page widgets to make it easy to display and customize your content.
Some also include posts below the widget areas which you may want to remove or hide from displaying.
To disable posts from displaying on these themes, there’s at least 3 ways to get the job done.
Use PHP Code To Remove Posts From Home Page
Simply add a line of code to your child themes home.php file.
You could also include this line in a custom function or add it with a conditional tag using the Footer and Header Scripts in your Genesis Theme Settings page.
remove_action( 'genesis_loop', 'genesis_do_loop' );
Not using the Genesis theme framework Change the hooks to your own theme specific hooks.
You can also use a custom function with the conditional tag for the home page in your child themes functions file like this:
This screenshot shows the remove action for the Genesis loop at the top of the file.
The code removes any blog posts from displaying on the home page.
Using CSS To Remove Home Page Blog Posts
You can also paste some CSS code into your child themes style.css file and this will also hide your latest blog posts from displaying on your home page:
.home .hentry {
display: none;
}
Use Plugin To Remove Posts in Category From Homepage
If you only want to remove posts from one category displaying on the home page you can install a plugin to get the job done.
The plugin simply adds a check box to all your categories which you can enable on an individual basis.
This means you can prevent posts from multiple categories from displaying on your home page or blog page.
The plugin simply removes the posts in that category from being included in the main loop.
This plugin also enables you to remove posts from specific categories from displaying in your RSS feed.
There’s more ways to remove posts from displaying on your home page i’m sure.
Do you know of any?
Was This Tutorial Helpful?