• 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

Include Different Post Types In Your Home Page Loop

This post includes several PHP snippets you can use to include different posts types on your home page loop.

Here’s the question this post provides the answer to:

I am wanting to add a CPT to the homepage along with Posts

Copy one of these snippets from the view raw link in the Gist and paste it at the end of your child themes functions file using a code editor.

All Post Types

This code will include all post types like posts, pages and custom post types.

Posts & Custom Post Types

This code will include your regular posts and the post type you add to the array in the code. Simply replace your-cpt with the name of your custom post type and add multiple CPT’s separated by a comma if needed.

Posts & Pages

This code includes both posts and pages in your home page loop

Reader Interactions

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