# Creating a dynamic attribute for WP post category

**URL:** <https://forum.pinegrow.com/t/creating-a-dynamic-attribute-for-wp-post-category/9108>\
**Category:** Pinegrow PRO\
**Tags:** wordpress\
**Created:** [August 29, 2024, 4:50pm UTC](https://forum.pinegrow.com/t/creating-a-dynamic-attribute-for-wp-post-category/9108 "2024-08-29T16:50:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![muoto](https://avatars.discourse-cdn.com/v4/letter/m/e56c9b/32.png) [@muoto](https://forum.pinegrow.com/u/muoto)\
**Post date:** [August 29, 2024, 4:50pm UTC](https://forum.pinegrow.com/t/creating-a-dynamic-attribute-for-wp-post-category/9108/1 "2024-08-29T16:50:40Z")

</div>

Hi, I’m trying to figure out how to add dynamic attributes to HTML elements in the Pinegrow editor. I have a WP Loop Action that retrieves posts, and I would like to add the category name or slug to the individual items, wrapped in a `data` attribute called `data-term`.

Outputting something like this

```auto
<ul>
    <li data-term="category-name">
        <a href="">Post Title</a>
    </li>
</ul>

```

Is this possible?
