How to change archive.php title with the_tags search result
-
In my archive.php file I’m trying to produce a title to the search result that is customised depending upon what the person clicked on. For example, if they click Archive December 2006 link, the archive.php result will display the title ‘Here is a list of all excerpts from posts within December 2006’. That bit is easy.
But what happens when someone clicks on a tag? I’d like the archive.php to display the result page to show something like ‘Here is a list of all excerpts from the tag ‘tagx’. I’ve tried:
if (is_archive('archive')) {echo "You are viewing all exceprts from "; the_time('F Y');} elseif (is_archive('the_tag')) { echo "You are viewing all excerpts from the tag "; the_tag('');}
…but nothing happens.
Oh, I’d also like to do the same for the search word as well.
Any clues?
fankyouverymuch
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘How to change archive.php title with the_tags search result’ is closed to new replies.