Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created February 10, 2014 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/8919367 to your computer and use it in GitHub Desktop.
Save billerickson/8919367 to your computer and use it in GitHub Desktop.
<?php
/**
* Add Tips to Blog
*
*/
function be_tips_in_blog( $query ) {
if( $query->is_main_query() && !is_admin() && ( $query->is_home() || $query->is_tag() || $query->is_category() ) )
$query->set( 'post_type', array( 'post', 'tips' ) );
}
add_action( 'pre_get_posts', 'be_tips_in_blog' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment