Tell us what you are trying to do?
I am busy developing a Pet listing site and need to show an Author Profile link on a single listing post. When you click on the link, it should show you the details about the auhor and I would like to list all the authors listings in his profile. I did create a new Archive template and assigned the Author Archives to it. When I view the front end, its says "No items fount". I'ts as if the Author Archives is not registering the content?
Will you be able to assist?
Hi,
Thank you for contacting us and I'd be happy to assist.
To troubleshoot this, I'll need to see how this author archive is set up in the admin area.
Can you please share temporary admin login details, along with the link to an example author archive page?
Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.
regards,
Waqar
Thank you for sharing these details.
By default, the author archive page only shows the results from the "Posts" post type.
To include the results from other custom post types too, you can use the "pre_get_posts" hook.
For example, suppose you have a custom post type with slug "find-a-pet" that you'd like to include these posts in the results shown on the author archive page. The code, in this case, would look like this:
function custom_set_post_types_author_archives($query) {
// if author archive page
if ( (!is_admin()) && (is_author()) )
// include selected post types in results
$query->set( 'post_type', array('find-a-pet', 'post') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_set_post_types_author_archives');
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.