Jos
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Viewing topic 1 (of 1 total)
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Author archive for custom post type
Started by: Jos
in: Toolset Professional Support
Problem: The issue here is that the user wanted to add custom post types to the Author Archive for their users. Solution: 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. |
|
2 | 3 | 4 years, 4 months ago |
Viewing topic 1 (of 1 total)