GraphicRiver

"is_archive()" Am I missing something?

816 posts
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Bought between 1 and 9 items
  • Contributed a Tutorial to a Tuts+ Site
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
+4 more
Parallelus says

I no longer include the “archive.php” file in my themes because I have “date.php”, “category.php”, “author.php” and “tag.php” to handle the requests. What I’m wondering is, can you directly target the “archive.php” file or return a TRUE value for the “is_archive()” function that does not go through one of these other files?

The WP Codex states:

Function Reference/is archive

This Conditional Tag checks if any type of Archive page is being displayed. An Archive is a Category, Tag, Author or a Date based pages. This is a boolean function, meaning it returns either TRUE or FALSE .

http://codex.wordpress.org/Function_Reference/is_archive

To me that means “archive.php” is a catchall for these other queries, but when you look at the diagram for template hierarchy it shows a separate branch for “is_archive”

http://codex.wordpress.org/File:Template_Hierarchy.png

Am I missing something? Is there a way to directly target this file with a WordPress query?

2933 posts
  • Community Superstar
  • Sold between 1 000 and 5 000 dollars
  • Bought between 10 and 49 items
  • Has been a member for 2-3 years
  • United States
  • Exclusive Author
chrisakelley says
Parallelus said
I no longer include the “archive.php” file in my themes because I have “date.php”, “category.php”, “author.php” and “tag.php” to handle the requests. What I’m wondering is, can you directly target the “archive.php” file or return a TRUE value for the “is_archive()” function that does not go through one of these other files?

The WP Codex states:

Function Reference/is archive

This Conditional Tag checks if any type of Archive page is being displayed. An Archive is a Category, Tag, Author or a Date based pages. This is a boolean function, meaning it returns either TRUE or FALSE .

http://codex.wordpress.org/Function_Reference/is_archive

To me that means “archive.php” is a catchall for these other queries, but when you look at the diagram for template hierarchy it shows a separate branch for “is_archive”

http://codex.wordpress.org/File:Template_Hierarchy.png Am I missing something? Is there a way to directly target this file with a WordPress query?
http://codex.wordpress.org/Function_Reference/is_author http://codex.wordpress.org/Function_Reference/is_category http://codex.wordpress.org/Function_Reference/is_date http://codex.wordpress.org/Function_Reference/is_tag

EDIT : I think thats what your getting at right?

by
by
by
by
by