612-293-8629 [email protected]

It took me a lot of googling, but I finally found a solution to getting my WordPress custom post types to display on archive pages!  Hooray!  I know I did this before (probably numerous times), but I was too tired to go looking through old code.

Thanks to ma’ main man, Chris, for the following lovely chunk of code:

function namespace_add_custom_types( $query ) {
  if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) {
    $query->set( 'post_type', array(
     'post', 'nav_menu_item', 'insert-your-custom-post-type-name-here'
		));
	  return $query;
	}
}
add_filter( 'pre_get_posts', 'namespace_add_custom_types' );

Just add the above code to your functions.php file in your theme, and you will be off to the races!

PHONE, EMAIL, TEXT

We love to communicate: phone, email, text, Facebook, Twitter, LinkedIn, you name it.

LOCATIONS

PAYMENTS ACCEPTED

Call Now

Enroll in Our Free Beginner WordPress Class by Email

Never feel powerless in WordPress again!  Become a WordPress superstar for free in only minutes a day!

Our Beginner WordPress Email Class is delivered to your inbox!

Learn More 

You Have Successfully Enrolled! Prepare For Amazing!