Created
December 14, 2015 17:25
-
-
Save jserrao/0aadae4ecbac881170b5 to your computer and use it in GitHub Desktop.
Conditional Wordpress Archive Check for archive.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A lot of this conditional checking is deprecated now with the_archive_title(); | |
// See how it works here: https://developer.wordpress.org/reference/functions/get_the_archive_title/ | |
// 1- Check for Date Archive | |
if (is_date() == true) { | |
} | |
// 2- Check for Tag Archive | |
elseif (is_tag() == true) { | |
} | |
// 3- Check for Category Archive | |
elseif (is_category() == true) { | |
} | |
// 4- Check for Taxonomy Archive | |
elseif (taxonomy_exists() == true) { | |
} | |
// 5- Check for Author Archive | |
elseif (is_author() == true) { | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment