Hello
I'm trying to display custom post types posts on the author page (the default one from wp that is listing posts written by the author). Is there any options that Toolset is providing for this?
You can use the function below in order to do this.
<?php
function post_types_author_archives($query) {
if ($query->is_author)
// Add 'books' CPT and the default 'posts' to display in author's archive
$query->set( 'post_type', array('books', 'posts') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'post_types_author_archives');
?>
What you need to do is add the slug for the post type in array. Then add the following to the Toolset Custom code section in Toolset->Settings ->Custom Code and then activate it.
I'm using the Astra theme, but when I put this code in it's functions.php file or when I activate the Custom Code in Toolset it gives me a database error.