I am currently using a sidebar in WordPress, and displaying ‘Archive’ and ‘Popular Tags’ in the side column.
For Example – Archive code
<div class="populartags">
<?php
$tags = get_tags();
$html = '<div class="post_tags">';
foreach ( $tags as $tag ) {
$tag_link = get_tag_link( $tag->term_id );
$html .= "<a style='color:#333;' href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
$html .= "{$tag->name}</a>";
}
$html .= '</div>';
echo $html;
?>
</div>
This displays any tags which have been used on a post.
I also have Archive (Dates) –
<?php wp_get_archives(); ?>
These pages, go to archive.php, which is great.
What I am tyring to achieve. Is a line of text, which says
‘ Here are the posts for (Archive / Tag).’
So, If I viewed posts from May 2015. It would say ‘Here are the posts for May 2015’
Anyone got any ideas?
You need to edit
archive.php
Just add
This displays either the date, or the tag and the number of results incase people are still looking: