# blog tags not linking correctly

**URL:** <https://community.hubspot.com/t/blog-tags-not-linking-correctly/114869>\
**Category:** CMS Development\
**Created:** [August 20, 2024, 5:40pm UTC](https://community.hubspot.com/t/blog-tags-not-linking-correctly/114869 "2024-08-20T17:40:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dm2/32/39641_2.png) [@DM2](https://community.hubspot.com/u/DM2)\
**Post date:** [August 20, 2024, 5:40pm UTC](https://community.hubspot.com/t/blog-tags-not-linking-correctly/114869/1 "2024-08-20T17:40:21Z")

</div>

Hi folks  
I am showing a custom news listing where the user can select a number of blog posts to display.

```lia-code-sample
{% for item in module.blog_article.page_field %}

{% set contents = content_by_id(item) %}
{% for content in contents %} 

<div class="col">
<a href="{{content.absolute_url}}"><img src="{{ content.post_list_summary_featured_image }}" alt="{{ content.name }}" loading="lazy"></a>

{% for topic in content.topic_list %}<a href="{{ blog_tag_url(group.id, topic.slug) }}" class="tag">{{ topic.name }}</a>{% endfor %}			

<h5><a href="{{content.absolute_url}}">{{ content.name }}</a></h5>
<a href="{{content.absolute_url}}"><strong>> Read more</strong></a>

</div>

{% endfor %}
{% endfor %} 

```

I’m finding that the tags are showing but the links are either referencing an old blog or not linking anywhere at all (all the other content of the post is showing correctly). I’m completely stumped as I’ve used this code on many other sites.  
Is this anything to do with the page being in a staged environment perhaps? I did try a test publish but still had the problem though.

Any help appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![GiantFocal](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/giantfocal/32/230943_2.png) [@GiantFocal](https://community.hubspot.com/u/GiantFocal)\
**Post date:** [August 21, 2024, 8:47am UTC](https://community.hubspot.com/t/blog-tags-not-linking-correctly/114869/2 "2024-08-21T08:47:01Z")

</div>

Hi @DM2,

Your

**blog\_tag\_url**

is not working because of the

**group.id**

prints nothing.

The

**group.id**

hubL variable only works on blog listings and posts, not on pages.

To fix it, you must replace

**group.id**

with your actual blog ID.

`{{ blog_tag_url(00000000, topic.slug) }}`

Best regards,

**Abraham Ernesto**

---

<div class="post-metadata">

**Author:** ![DM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dm2/32/39641_2.png) [@DM2](https://community.hubspot.com/u/DM2)\
**Post date:** [August 21, 2024, 9:33am UTC](https://community.hubspot.com/t/blog-tags-not-linking-correctly/114869/3 "2024-08-21T09:33:05Z")

</div>

Brilliant - @GiantFocal thank you so much for this.
