You need to add this code to the file functions.php
.
function custom_post_author_archive($query) {
if ($query->is_author)
$query->set( 'post_type', array('post-type', 'post') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_post_author_archive');
Related Posts:
- Newer/Older posts links display same posts on every page
- How do I write this SQL statement for Posts written in last 24 hours?
- How to show related posts by category or custom post type?
- How to create posts (not post template) to be displayed on projects page?
- IF statement in a do_shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_template_part for custom post type content not working
- Loop on front-page.php
- How to get all posts except for one post from a certain custom post type?
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- Shortcode not working with post counter
- Conditional for a Single Post That Belongs to a Category?
- How to Make infinite loop of post
- WP_Query with custom post type ID
- display posts of custom post type with custom taxonomy
- Get post format
- Custom wordpress loop
- displaying content of custom post type
- Posts are not rendering perfectly [closed]
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- How to fetch posts that are stored in the different table than (default) wp_posts?
- If/Else child list for Custom Post Type single template within loop?
- SEARCH QUERIES – REVERSE OUTPUT
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Display title of all custom posts from same taxonomy term on a custom post template
- Custom post Query and WordPress Post Query Clash
- Only show current category post
- How To Loop Through list with Custom Post Types
- How to create content automatically when a post is published?
- Turn post into simple slideshow
- Pulling in a particular post into a single page based on the post id passed into the code
- Styling first post using Advanced Custom Fields
- the_content() stop images being pulled through
- Linking Two Post Types
- Get Custom post with ID
- Pull Two Posts Into Custom Post Type `single-cpt.php`
- Problem excluding category from get_next_post
- WP_Query to loop a Custom Field, Custom Post Types do not show
- Posts in Multiple Columns and Rows with one single loop
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- How to show posts from multiple post types in a single loop? And display them separately on the same template
- ‘category__and’ for custom taxonomy?
- How to use custom fields to enable sticky posts on custom post types?
- Show Two custom Post type and their posts on category page
- Custom post type and body_class: Remove “blog” class
- How to insert content from another Custom Post type into Post?
- get_attached_media() on author page not working
- Getting posts under the custom post type ui category
- Calculate all custom field values in the post loop
- Checking if Post Title is Unique as Loop Criteria
- JS innerhtml changing style when using AJAX
- What to and how to proceed with CPT to make DB small and efficient?
- A custom post within a custom post
- get_the_title() is returning results from previous loop
- wordpress remove views from action links in a custom post
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- 3 random images from custom post type, each in a div with a diffrent class
- Displaying multiple post types on home page
- Shortcode leaves no space for other elements?
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- Query to get child pages of current page and display it in action hook
- Template code to split a post and print a custom field?
- Send post changes to set email addresses (not users or subscribers)
- Add Class according to the order of appearance
- Custom post type filter is being applied to all of my posts
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Get_post_custom not fetching value from array wordpress
- Display Parent-Child Posts in specific order by comparing IDs in array
- What is the best way to structure posts for the same event happening in different years?
- How to display custom field in product description?
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Multiple Loops In Tabs Only Displaying First Loop
- Is there a way to create a sidebar of bullets
- post_type incorrect for custom post type
- Skip latest 3 posts from loop
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- I cannot display custom posts in custom taxonomy
- How to build Custom Post Nav Menu inside of the Loop
- Loop to display parent categories in custom taxonomy
- How to get the posts that my following users are liked?
- How to insert post 6 times after user register like ask.fm
- Display related post content and custom field content
- Creating custom post type relationships
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Custom Post Type + Category archive
- erase post excerpt limitation [×]
- Posts without featured image using other post’s featured image
- Get result from Custom Field in Custom Post type
- Custom post-type’s pagination not working in category.php
- Custom My account page and custom page for editing posts
- Get Posts From A Certain Post Type In An ID Array
- How to make a non-public post on wordpress approval?
- is therer any wordpress function to retrieve a specific html element from post content
- WordPress post objects in one parent post object