I am trying to make my own theme by adapting a blank one.
I would like to display the tags across the top of the page where the list of pages is.
You can see my 'work' so far:
http://j-dog.co.uk/test/
See where it says About, Contact etc I would like the tags there instead.
Any ideas?
Thanks
Try this in your theme's header.php file (replace the existing menu div):
<div id="menu">
<ul>
<?php
$tags = get_tags(array('orderby' => 'name', 'order' => 'DESC'));
foreach ( (array) $tags as $tag ) {
echo '<li class="page_item"><a href="' . get_tag_link ($tag->term_id) . '" rel="tag">' . $tag->name . '</a></li>';
}
?>
</ul>
</div>
May need a bit of adjustment, but that should do it.
Thank you.
And if I wanted to display categories I would change 'tag' to 'category' in there?
joe3000
Member
Posted 3 years ago #
Ok that didn't work for categories, anyone else got any idea?
Thanks.
The Amazing Grace theme uses categories in the header nav so might look at how that theme does it:
http://wordpress.org/extend/themes/amazing-grace