Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active December 27, 2018 22:43
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/e5ae64aa966cdee7f4baef846746bd66 to your computer and use it in GitHub Desktop.
Save billerickson/e5ae64aa966cdee7f4baef846746bd66 to your computer and use it in GitHub Desktop.
<?php
/**
* Include portfolio on author archive
*
*/
function be_author_query( $query ) {
if( $query->is_main_query() && ! is_admin() && $query->is_author() ) {
$query->set( 'post_type', array( 'post', 'portfolio' ) );
}
}
add_action( 'pre_get_posts', 'be_author_query' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment