Your code simply adds post types to the query when on the author archive so to do the same with date archive simply replace is_author
to is_date
:
function custom_post_date_archive($query) {
if ($query->is_date)
$query->set( 'post_type', array('wp_plugin_review', 'png_gallery', 'post', 'news') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_post_date_archive');
Related Posts:
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Why are posts from custom post type not displayed in “category” archive?
- Custom Post Type Archives by Date and Taxonomy
- Custom post types – Use post_id in permalink structure when using has_archive => true
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Custom Post Type Archives by Date with Custom Permalink
- Filter for “get_post_type_archive_link()”
- How to add meta box to backend menu page
- Change title in head on Archive page
- Multiple Paginations on one Page
- Page is defaulting to archive page and not designated template
- WordPress custom post type category pagination 404 Error
- Custom Permalinks for Custom post Type Archives?
- is_singular won’t call my functions?
- Show Custom Post Type by Author
- Custom post type archive with pagination?
- Pages, Custom Posts & Custom Taxonomy defining slug structure
- How to show a tag archive of one post type only
- Regex problem in an add_rewrite_rule
- Custom taxonomy archive page not working
- wrong template for page of archive
- How to show multiple post types on taxonomy archive?
- Disable single pages and archives and keep preview
- Custom post type with tags
- List custom post type but redirects to home page
- Custom Post Type with static page for archive
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- CPT: archive-cpt.php VS custom page template
- Category page only displaying the posts from a custom type
- Custom post type archive page pagination
- Need post_type_archive_title function but in ‘single’
- Display custom post type taxonomies as an archive page
- Change name of custom post type archive
- Editable content on a Custom Archive page
- Second Custom Post Type Archive
- How to show the archive / post type description on Single templates
- is_main_query() not working for WP REST API
- Hierarchical Custom Post Types – Show only parent on tax archive?
- just can’t get date-based archives per post-type to work
- Archive page for taxonomy terms
- How can i change the output of posts_nav_link();
- get the custom post type title/name
- Get archive post type name
- Filtering WP_Query
- Custom Post Type with archive page but no detail page
- Custom post type – get_day_link()
- Why is my site using index.php instead of archive?
- Custom post type archive page blank
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Custom archive page for CPT UI
- How to display custom post in archive section of the wordpress page?
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Archive for CPT
- how to remove pages loading with the archive templates
- Archieve.php not loading for custom post type
- Custom Post type & Taxonomy 404
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Dynamically insert an article at the top of a taxonomy archive – or?
- Archiving custom post content?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- Archive Page for Multiple Custom Post Types
- Can’t access private custom posttype single- or archives-page
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- How can I relate custom post types?
- Archive page for custom post type and custom taxonomy
- Why does my URL keep returning 404 error code?
- Display CPT index page as front/home page
- Event Archive by Month
- How to have multiple archive pages?
- Create a Custom Path to Archive
- Advanced archive url structure (category, tag and date)
- Listing authors and date archive from custom post type
- WordPress sitemap with Custom Post Types
- Display all Categories except ones with a specific parent
- How to achieve a multi-taxomony layout with posts?
- Archive per year of a custom post getting the wrong post
- Creating archive like functionality through birectional relationships
- How to show custom post count in archive page
- Do not show child pages within a file page
- Tell wordpress to show a single page instead of an archive page
- Archive for custom taxonomy
- Custom post type categories giving 404
- Adding Custom Post Types to category/tag/author archives breaks header content
- Custom category taxonomy – archive page not showing up
- How can i remove post type archive URL?
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom taxonomy archive slug overwrites static page
- How can I generate a list of post-type specific categories?
- date archive future posts
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- Keep same archive.php for post from archive?
- archive.php can’t find categorized posts
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- How can I set up the URL for a category archive for a custom post type?
- ‘Blog Archive’ suddenly appeared on custom post type; how to remove
- Is it possible to remove the word “date” from archives?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Generate daily archive whenever any post type is added