Ok, so I found the solution to this problem and I thought I’d post it here for anyone else who may stumble upon this question.
Turns out I was making this much more difficult than it needed to be. I just added a simple function to the custom site plugin I created (this could also be added to your functions.php file).
function hea_cpt_author( $query )
{
if ( $query->is_author ) {
$query->set( 'post_type', array( 'post', 'events', 'recipe' ) );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
}
add_action( 'pre_get_posts', 'hea_cpt_author' );
The hea_cpt_author portion can be whatever you want to name your function.
Related Posts:
- Adding custom tables to WordPress
- Assign External Database Queries to Global Variables and Make Them Accessible
- How to import a custom MySQL DB table into a WordPress custom post type
- Function causing the loop display posting more (empty)
- How do I programmatically add items of content to a custom post type?
- is_singular won’t call my functions?
- Include images from pages in wp search.php results in default wp search
- Create Pages from Database
- Ajax filter with custom taxonomies
- List events by month
- Custom post type loops with different page templates
- Combine tax_query and meta_query in WP_Query
- How can I programmatically save data into custom fields that contain serialized data?
- Adding a span when custom post type is updated
- Row actions not showing? Why?
- Displaying custom post type on front page
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- Dynamic Custom Post Type Plugin
- How to filter out post type meta?
- Link users to a custom post type
- Weird problem happening with custom taxonmy when creating/updating posts
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- $wpdb: Counting posts corresponding to 3 terms in 3 different taxonomies
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Get posts from a custom post type by child categories of a parent category
- get the custom post type title/name
- Push metadata in array
- CPT + CMB2: data not displaying for only first post in loop
- Convert simple SQL Query to WordPress query
- Query & Order posts by custom fields
- ACF field key/value to show on taxonomy list
- Using custom field content as expression in IF statement [closed]
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- WordPress custom post type split into pages
- search suggest – filter post type
- Make a custom_post translatable
- How to update post meta on uploaded image from a custom form?
- Configuring a meta query with multiple post types that have the same relationship on a single page
- wp_insert_post sometimes fails after API call
- Specifying Mouseover Icon for Custom Post
- Trying to get custom post of a custom taxonomy
- Loop increase number
- Front end access to a SQL data repository – recommended way?
- Is This Code Efficient – Or is there a better way?
- Filter content in shortcode
- Custom post type and custom taxonomy 404 on page 2
- Show current user posts in custom post type query
- Nested Custom Taxonomies | Incorrect posts when querying
- Validate Custom Post Type fields
- meta query not retrieving posts
- How do I get the index for a custom post?
- Commas not displaying in implode
- add custom tags for custom post type in wordpress
- CPT Repeatable Fields + Undefined Index
- foreach loop inside the loop creating duplicates in output
- Function to erase every post from a taxonomy
- Custom Post Type Causes Error: Warning: call_user_func_array()
- Group episodes by seasons
- Is it a connection or relationship between 2 custom post types?
- redirect after submiting post for review
- CPT loop doesn’t seem to account for post date?
- Custom front-end form for adding post – Category problem
- Get only parent post in archive post
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- Sort custom post column by generated value?
- Custom post type and custom taxonomy key lenght & query performance
- Custom post type order by post_title
- Tell wordpress to show a single page instead of an archive page
- Get meta values from parent post and save in child post
- Sql Update CPT from publish to draft and particular custom field
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- PHP Notice: Unidentified index
- Add active class to foundation 6 tabs while looping categories
- Duplicate posts in my custom loop
- Include images from pages in wp search.php results in default wp search
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- Meta box not saving
- Featured image in custom post is being disabled
- Why is my custom post type slider only displaying the latest slide?
- Custom Search not working
- using ACF datepicker to filter posts on a page
- WordPress multi-query not returning as expected
- Custom Post-type not returning the right child_of
- Filtering problem
- WordPress Set A Static Page/Template For All Sub-Pages
- Add HTML before a specific div?
- How to hide home title on pages and posts?
- Is there any way of not using my_init_method in the following code (that creates a custom post type)?
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Send email on creation of custom post type and use get_post_meta()
- Just the First Metabox what saves the data!
- Assign a tag to custom post type using a query