Skip to content

Instantly share code, notes, and snippets.

@TheCraigHewitt
Last active December 6, 2021 12:34
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 TheCraigHewitt/eddedb0c4fef728bfd7c6a2975fcb708 to your computer and use it in GitHub Desktop.
Save TheCraigHewitt/eddedb0c4fef728bfd7c6a2975fcb708 to your computer and use it in GitHub Desktop.
Seriously Simple Podcasting: Add blog categories to podcast episodes (frontend).
add_action( 'pre_get_posts', 'ssp_add_podcast_to_category_archives' );
function ssp_add_podcast_to_category_archives( $query ){
if( is_admin() ) {
return;
}
if( $query->is_tax('category') || $query->is_category()) {
$query->set('post_type', array( 'post', 'podcast' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment