I want to include custom post type in the author arhive page. I tried the method discussed in this post:
add_action( 'pre_get_posts', 'custom_post_author_archive' );
function custom_post_author_archive( &$query )
{
if ( $query->is_author )
{
$query->set( 'post_type', 'custom_name' );
remove_action( 'pre_get_posts', 'custom_post_author_archive' ); // run once!
}
}
But by this method, only the custom_name posts are queried. I want to query both the custom_name posts and the normal posts.
What changes will I have to make?