Skip to content

Instantly share code, notes, and snippets.

@anatol06
Last active May 6, 2018 16:53
Show Gist options
  • Save anatol06/47836f95a24d9e5deb24a9a64d90eae6 to your computer and use it in GitHub Desktop.
Save anatol06/47836f95a24d9e5deb24a9a64d90eae6 to your computer and use it in GitHub Desktop.
Get the title for Archive or Search pages
<!-- 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