# How to add unique text below each category image?

**URL:** <https://meta.discourse.org/t/how-to-add-unique-text-below-each-category-image/265792>\
**Category:** Development\
**Created:** [May 22, 2023, 11:15am UTC](https://meta.discourse.org/t/how-to-add-unique-text-below-each-category-image/265792 "2023-05-22T11:15:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![pinder99](https://avatars.discourse-cdn.com/v4/letter/p/dfb087/32.png) [@pinder99](https://meta.discourse.org/u/pinder99)\
**Post date:** [May 22, 2023, 11:15am UTC](https://meta.discourse.org/t/how-to-add-unique-text-below-each-category-image/265792/1 "2023-05-22T11:15:04Z")

</div>

How to add custom text when class for each category is same , like if i want to add some text below .category-logo.aspect-image img it will add custom text to all categories , how to add unique text below each category image , i tried adding new class to each category and then added text with class::after it is working fine but it only shows after reloading page every time

```js
<script>
  document.addEventListener("DOMContentLoaded", function() {
    $(function() {
      var categories = [
        {
          logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
        {
          logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
        // Add more objects for other categories
        {
         logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
        {
         logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
        {
        logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
        {
      logoUrl: "/uploads/default/original/1X/4a4fcfc",
          line1: "SOME TEXT",
          line2: "<a href='https://EXAMPLE.com' style='color: #646464;'>WWW.ATALANTA.COM</a>"
        },
      ];

      $(".category-heading").each(function(index) {
        var category = categories[index];
        var $logoElement = $(this).find(".category-logo img");
        var $descriptionElement = $("<p>")
          .html(category.line1 + "<br>" + category.line2)
          .addClass("custom99"); // Add your custom class name here

        $logoElement.after($descriptionElement);
      });
    });
  });
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-unique-text-below-each-category-image/265792)._
