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

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

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:

Register for full access

Blog Page pre_get_posts

Reader Interactions

Comments

  1. Susan Sezgin says

    July 3, 2020 at 7:05 am

    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!

    Log in to Reply
    • Brad Dalton says

      July 3, 2020 at 7:34 am

      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.

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.