Forum

Thread tagged as: Question, Problem, Blog

How do I add tags to the individual post page in the Blog App.

How do I add the tags of a individual post onto the post page so they show? Having a little trouble working out what code to include in my post.html that would take the tags i include in the admin when creating the post and simply placing them in the post for people to see what tags are applied to it.

Probably really simple but can anyone point me in the right direction?

David Springate

David Springate 0 points

  • 7 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I'm not sure what you mean. If you add Perch Tags to the master template for blog (post.html) then they will show up in admin to be completed and then display on the blog detail page on your site.

https://docs.grabaperch.com/addons/blog/template-tags/

That link was what I needed, needed to display tags in the post.html template but had id="tagTitle" instead of id="postTags" in my variable. Sorry for the confusion, its early.

Thanks for your help Rachel!

One other thing that you might be able to help me with though is that my code currently looks like this...

<perch:before>
  <ul>
    </perch:before>
        <li><a href="archive.php?tag=<perch:blog id="tagSlug" />" rel="tag"><perch:blog id="postTags" type="" /></a></li>
    <perch:after>
   </ul>
</perch:after>

However, I've added 3 tags to my example post and when I hover on the list of 3 tags on post.php it is selecting the whole list and not the individual tags? Where am I going wrong?

Much appreciated

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I don't understand what you are trying to do there, but it doesn't look valid.

If you just want to output the tags for a post you can use the page function (assuming s is your querystring parameter)

<?php perch_blog_post_tags(perch_get('s')); ?>

https://docs.grabaperch.com/addons/blog/page-functions/perch-blog-post-tags/