When you click on an author link generated in the normal way, the server will not know that you only want the custom posts from this author returned. So you will have to tell the server. This is perfectly doable, but a bit too much work to write it down here completely for you. Here are the steps roughly:
-
Use the filter
author_link
to attach the string"?post_type=your-cpt-name"
to the link generated on cpt posts. When clicked this will tell the server that you want only cpt posts on this author archive page. -
Use the filter
pre_get_posts
to modify the default author archive query. Inside the function for this filter you can useget_query_var
to retrieve the value ofpost_type
and restrict the query to only cpt’s (this might even happen automatically, though I’m not sure about that)
Related Posts:
- Page is defaulting to archive page and not designated template
- Create template for taxonomy results limited by Custom Post Type
- How can I use archive-{post_type}.php theme template?
- Specifying a template for custom post type pages
- get_permalink() of page the enclosing page not posts
- Custom post type with two templates
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Custom Post Type Settings page, choose page to display archive
- Adding a menu item for a Custom Post Archive
- Adding custom post type archives to a WordPress menu
- Custom Post Type Template – Archive
- previous_post_link() and next_post_link() with a custom post type?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- How do you create an archive for a custom post type from a plugin?
- Custom Post Type Archives by Date with Custom Permalink
- How to set a fall back template for a custom post type in a plugin?
- How to List All Custom Post Types Names (Not Posts)
- Change title in head on Archive page
- How to list/show all custom post types regardless of category?
- Custom Post Type archive as front page
- How to query custom posts using a dynamic category
- Custom Post Type with Nested Taxonomy and Template Files
- Adding Sticky functionality to Custom Post Type Archives
- Create Pages from Database
- Adding custom post types to archive.php
- Custom post type loops with different page templates
- archive-{$post_type}.php not loading. instead the default archive.php loads
- Include different loop templates in search query
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- WordPress custom post type archive with description
- Display Next/Prev when looping Custom post-types archive?
- Archive page for custom post type not working
- Multiple templates for a custom post type
- How can I filter by taxonomy on a custom post type’s page?
- CPT Archive with core Category
- get the custom post type title/name
- Custom post type templating problem
- Displaying Page as Custom Post type landing Page
- CPT archive admin menu label
- Custom post type archive page blank
- Creating a Custom Post Type
- WordPress Doesn’t Generate Taxonomy Archive
- Content Editable CPT Archive?
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- WordPress custom taxonomy template not working
- Paginate_links in custom post type template
- How to specify a template for a path like http://example.com/something?
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- WordPress 3.9 not using custom template
- How to Create Template File for Parent Page of Custom Post Type
- Custom post_type search pages
- how to remove pages loading with the archive templates
- Custom Empty Results page for my Custom Post Type
- How to hyperlink content from archive page with custom post-type
- Loop through custom posts by taxonomy and display the titles in a list, it is repeating 8 times
- Custom post types with categories in template
- How can I trace inconsistency in loading a template?
- ACF for custom post type archive pages: which hook to use?
- assign different templates to custom post type with homepage loop
- CPT Archive pre_get_posts not working?
- Custom post type draft use wrong template
- How can I add in post’s the text “No content”
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- CPT archive page – show one post from each taxonomy term
- Calling a div and content in php?
- Tag template not returning posts [closed]
- Custom post type set default template using block editor
- A certain theme is forcing it’s singular post layout
- Different number posts per page based on custom post type term id
- How to change URL for custom post type archive?
- Displaying all posts by category and showing content on click
- Post template not applying on theme (potentially rendering as Page template)
- Custom Post Taxonomy Template Not Loading Properly
- Is it possible to link an external stylesheet, exclusively within a specific single post template?
- Tell wordpress to show a single page instead of an archive page
- Templating advice sub posts of a CTP
- Custom post pagination not working
- How to override post-new.php with custom template
- Custom post type post_type_link gives “page not found” on any other custom post type
- Can I organise my custom post types by page?
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Redirect to different template other than single-custompost.php
- Rewriting archive page slug to be different than custom post type slug
- custom post type plugin – single template
- Site loads very slow for archive custom post type page
- Have two (permalinks) urls for a same custom post type
- How to display the FAQ Archive page in my menu
- Storing postID in session variable to query database when visitor on custom template page
- How can I set up the URL for a category archive for a custom post type?
- Create a Page Templete to Display Table Of Content for Custom Taxonomies
- How to make a template for a specific post of a custom post type?
- WP_Query is getting the post but the_post() not rendering any Post
- Dynamic WordPress rewrite rules for multiple custom post types
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query