Exclude From Genesis Blog Page Template

This code enables you to exclude single posts & pages as well as posts in different types of archives like author, category, search, and tag archive type pages.

Simply add to your child themes functions file and swap out the i.d to suit your needs.

The code determines if the blog template ( included in Genesis ) is being loaded. You’ve probably tried using is_home(), is_page('blog') and is_page_template('page_blog.php') with pre_get_posts however those conditionals will not work with the blog page template.

Here’s the code for logged in members:


Comments

2 responses to “Exclude From Genesis Blog Page Template”

  1. Susan Sezgin Avatar
    Susan Sezgin

    Hi Brad,

    This code works great. I excluded the “Quotes” category from the blog page. However, I’m using the Ultimate Posts plugin in the sidebar to show a single, random quote on each page (from the posts in the “Quotes” category). They were showing up before I changed the blog page code, but now they aren’t showing up anymore. Any suggestions on how I can do this… Here’s the url, if that’s helpful… https://www.catherineplace.org/blog/.

    Thanks!

    1. Hi Susan. How did you create the blog page? Using a page_blog.php template, the reading settings to set the posts page or custom fields?

      If you use this code in your page_blog.php file, you won’t need to use the code in this post.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.