Last active
May 6, 2018 16:53
-
-
Save anatol06/47836f95a24d9e5deb24a9a64d90eae6 to your computer and use it in GitHub Desktop.
Get the title for Archive or Search pages
This file contains hidden or 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
<!-- Get Archive Title --> | |
<?php if(is_category()) { | |
single_cat_title(); | |
} else if (is_author()) { | |
the_post(); | |
echo 'Archives By Author: ' .get_the_author(); | |
rewind_posts(); | |
} else if (is_tag()) { | |
single_tag_title(); | |
} else if (is_day()) { | |
echo 'Archives By Day: ' .get_the_date(); | |
} else if(is_month()) { | |
echo 'Archives By Month: ' .get_the_date('F Y'); | |
} else if (is_year()) { | |
echo 'Archives By Year: ' .det_the_date('Y'); | |
} else { | |
echo 'Archives'; | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment