There is no logical explanation why if( is_post_type_archive('news) && is_date())
should fail and not work in your situation.
-
is_date()
return true on all date archives -
is_post_type_archive( 'news' )
will return true on post type archives
When you visit localhost/2016/02/?post_type=news
, both of those ring true, and they will only ring true on that specific URL
If it it fails, you have something breaking your main query, maybe a bad pre_get_posts
action or you are using query_posts
somewhere on the page which will break the main query object. You should do var_dump( $wp_query )
and inspect the main query object. Specially look at $query
property
Related Posts:
- Custom Post Type Archives by Year & Month?
- Custom archives function
- WordPress Posts By Date/Day?
- Preventing 404 error on empty date archive
- Output yearly archive within a page
- Archive filtering posts by year and month
- How to get the date dynamically from archive.php to date.php?
- Making next_posts_link(); return posts by month
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- How can I change the way dates shown in the archive widget?
- how do I get the date in a date archive page
- What’s wrong with my date_query?
- How we display Archives for specific categories
- get the custom post type title/name
- Displaying Archives List
- wp_get_archives() display months even if there is no posts
- Custom post type archive page thinks I’m not logged in
- Wrap the “show_post_count” between div
- Get current title of archive.php
- Get archives as array
- remove 2014 from wp_get_archives
- Get posts from a top category and group by child categories
- How to get post archives urls list without any markup?
- What do I need to style for the page after wp_get_archives?
- I created a normal page, but the page displays as an archive page
- How to get the Custom Post Type Archive inside a folder
- Combining custom taxonomy posts with default posts on one archive page
- Custom archive pages without “the loop”
- Show all 12 months regardless they have posts
- How to get type of archive whether it is post or date or category archive?
- Custom post archive page not opening 404 page
- How to disable date archives?
- Change Title Based on Taxonomy Filter in archive-{cpt}.php
- Want to display my custom date archive to date.php but dont know how
- date.php shows only three posts’ title. how to fix it?
- How to hide the year in archive link
- Is each issue of a magazine site a static page
- WordPress 3.6 – archive.php doesn’t get triggered [closed]
- Get list of years when posts have been published
- How can I lock down an old wordpress install I don’t intend to update?
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- How can I get the Month Name from Archive?
- Archive widget – limit number of months to 12
- Display all custom post types in archives.php
- How would you create a “weekly” archive?
- How to show specific year archive into dropdown list
- Custom post type archive sorted and grouped by date in post meta field
- How to make a custom Archive Page
- Arrange and separate posts
- Custom-post-type-archive: posts sorted/filtered by year?
- Preview Post/Custom Post types in Archive
- if there is only one post in the category, directly open
- Multiple filters for wp_get_archive
- How to disable monthly archive
- just can’t get date-based archives per post-type to work
- When i try to open archive pages i get a 404 error
- How to Create Custom Archive page
- How to show year/month archive including months with no posts
- How to display custom post in archive section of the wordpress page?
- If one taxonomy contains the same term as another then display post
- Having a problem with Next and Previous Links
- ‘Archive’ folder for posts and pages
- Filter post by clickable year [duplicate]
- Is a list page usually called an archive page in WordPress?
- I want my yearly archives to show a list of all posts
- How can I use archive-{post_type}.php theme template?
- Return the name of the post type
- Archive page showing wrong month
- Create an archive listing based on meta array
- Can’t Access Sessions or Variables through pages
- How to make an archive page template using WordPress 3
- How to Get The Excerpt of the page that displays Blog Posts
- Where is the content that is outputted by get_the_archive_description()?
- Create simple columned archive page
- wp_get_archives doesn’t take effect from css or html
- Create a custom URL for blog archive
- How can I create a master archive?
- Over 500.000(!) unwanted archive pages, major duplicate content problem
- Is possible register two archive pages for single custom post type?
- Link back to (paged) archive and find the correct page
- I want to be able to access archives to see how recently a post has been read: How can I do that?
- Overriding the template files using a plugin for all themes
- Custom Post Type archive page listing a 404 or single post
- google index an Post type page I do not want
- How to remove or hide archive page?
- Change the Page Title of the Archive Page for Portfolio Tags
- How to display archive by selecting year and then selecting month
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Archives widget doesn’t work?
- Stop Custom post type from being searched via URL
- Archive sorted by month – separate
- Yearly Archive Page?
- paging is not working properly on news archives page [duplicate]
- How to edit wordpress post without republishing
- How can i display in themplate file only a few post
- how to hide all posts under one category
- Pagination not working for archive
- Can a scrollable date picker be done in WordPress for archives?
- How to have infinite scroll consider passed parameters?
- How to display the archive for native posts