Skip Navigation

[Resolved] WordPress Archive Author pages not showing content

This support ticket is created 2 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 2 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2191815
Screenshot 2021-10-09 at 22.40.50.png
Screenshot 2021-10-09 at 22.41.05.png

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?

#2192629

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#2193835

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.