Problem:
The issue here is that the user wanted to add custom post types to the Author Archive for their users.
Solution:
This can be done by using the Hook below.
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('nota', 'post') ); remove_action( 'pre_get_posts', 'custom_post_author_archive' ); } add_action('pre_get_posts', 'post_types_author_archives');
Add the above to the functions.php file and just add your post type slug to the post_type array.
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 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 14:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Jamaica (GMT-05:00)
This topic contains 2 replies, has 2 voices.
Last updated by 4 years, 4 months ago.
Assisted by: Shane.