Hi deodev!
One way I can think of would be using the pre_get_posts filter.
Something like:
add_filter( 'pre_get_posts', 'add_post_types_to_author' );
function add_post_types_to_author( $query ){
// set the new post type to return, and check if we are in
// an author archive page
if( $query->is_main_query() && !is_admin() && $query->is_author() ){
$query->set( 'post_type', array( 'post', 'page', 'download' ) );
}
// Return our new query
return $query;
}
Sort of a rough start but you can alter to your choosing. You can use that in a child theme’s funtcions.php file, or a parent theme’s functions.php file, or even a functionality plugin. A little more information about the filter:
https://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
Hope that helps!
Hallo,
Pretty straightforward:
1) Create the custom post type – I assume you already have done this?
2) Create a template for the author page
3) In the template:
a) Get the current author id
b) Use a Standard loop wp_query that looks for all posts of the custom post type that are authored by the current author.
See
https://codex.wordpress.org/Class_Reference/WP_Query
https://codex.wordpress.org/Class_Reference/WP_Query#Standard_Loop
https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters
Hope this helps 🙂
Groetjes