You can simply use the default author.php page to do this. If you don’t have one, make a copy of index.php and rename it author.php
Now, use pre_get_posts to include your custom post type in the author pages. This code goes in functions.php
function cpt_on_author_page( $query ) {
if ( !is_admin() && $query->is_author() && $query->is_main_query() ) {
$query->set( 'post_type', array( 'post', 'philosopher' ) );
$query->set( 'posts_per_page', 10 );
}
}
add_action( 'pre_get_posts', 'cpt_on_author_page' );
Related Posts:
- Keep featured content post in homepage with original order
- How to show related posts by category
- the_author() returns empty string
- Display all posts from specific categories on a page
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- How to display posts by current user/author in a custom page template?
- Number of posts per page setting is not working?
- WordPress Posts Out Of Order after 3.1 Update
- Query only Posts from Both of Two Category?
- Can’t show comments count per post outside loop
- Order post by year DESC and month ASC
- WordPress get posts by date without query_posts
- Featured Posts for Category Pages
- Cannot Update A Post, 404 Error
- Function to show random posts from a category
- Hiding posts in a list from specified categories
- How would I get 1 latest post from a query for 5 posts?
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Create dropdown list post
- I would like to give special promotion for the first 100 posts in my blog? Can anyone tell me how to do that?
- Inserting custom data to the_post() during loop
- How To Get Posts With A Specific Word
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Why is querying posts messing up my pages?
- Display all posts that were published before full post on single.php
- Blog post per page setting conflicting with custom WP_Query?
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Random ajax load only works with posts_per_page set to -1
- posts_per_page option limits the number of Gallery items
- How to make multiple sections in home pulling posts category wise?
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Display Posts on Custom Page
- How to get posts from a current post’s month?
- Wrong post title displayed from loop
- While loop articles – if statement order
- Conditionals if tags exist?
- Get the amount of posts on a current page
- Posts – display all posts except a post by an ID
- Counter is skipping post when I still want it visible [closed]
- why the same code got different results when using query_posts in functions.php and index.php
- Archive template combined with post slider and regular posts
- How to get posts published on the latest date?
- How to only publish posts with image in it
- Post Filtering by GET URL parameters
- wp_query with ajax
- How to give classname to post if post has no content?
- WP_Query: Show 10 posts in date order, first three random
- Custom posts listing widget always returns 1 extra result
- Get post by tag
- Random posts that always include a particular post?
- Bootsrap carousel for post
- Get postlist for each category using query_posts?
- How to save posts position on homepage after random function?
- Echo the number of posts being displayed
- Exclude a category of posts in author template
- WordPress displays post on subcategory only
- Trying to query all posts in category 4
- Get posts from current category?
- Change content off every sixth element
- query for filtering published posts?
- Pull in posts using post meta for REST API
- get posts, run a custom query, and join the results
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- How to show post views shortcode data for each post on Posts List Page?
- How to display particular categorie’s post which associated to specific user?
- WP_Query to get posts in a specific tag or has post_format
- Make recent post display recent updated, instead of recent published
- Manipulate query to show specific post
- How to correctly escape data
- Blog posts not displaying on blog posts page
- Repeating post how to solve this
- Sort Events by Venue Title – Sort Post set by related post ids
- Get posts by category or author
- Sort / Filter Queries
- get_page_by_title() not working if special characters are present
- get “read more” with custom DB query like you would with WP Query
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- How do I control the fallback query after the original query returned cero posts?
- How to pass multiple checkbox values to wordpress query?
- Adding a category at even positions on main loop with modified pagination
- How to get all post titles starting with numbers and symbols?
- How to inject a post within a loop
- How to get alphabetic listing x other posts, based on first letter post?
- Creating pages and getting their values from the database table
- wp trim function not working
- Change from all posts to specific categories post on main page?
- query_posts different amount of posts per page [duplicate]
- Count words for all posts by all authors
- Word count for all posts of all authors
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Dynamic archive of posts by date
- How to change url of posts?
- Why does ‘get_the_ID’ work outside of the loop?