كيفية تغيير نص عنصر الـ span هذا بدون محددات؟

This object has the following HTML:

<span>Topic</span>

I’m wondering how one might use css to change this text to something else, e.g. “Blogs”.

EDIT: I would want to do this on a per-category basis.

إعجاب واحد (1)

This is customisable via /admin/customize/site_texts?q=Topics

I’m not sure exactly which one it is though…

You can figure it out by running I18n.enableVerboseLocalizationSession() in the JS console, reloading the page, then you’ll be able to correlate the number of the string with output in the console:

إعجابَين (2)

This would be for all categories though, right? I want to do it per category.

إعجاب واحد (1)

Hello :wave:

This is possible with CSS.

body.category-name {
  .topic-list-header {
    .default.topic-list-data {
      span {
        visibility: hidden;
        &:before {
          content: "Blogs";
          visibility: visible;
        }
      }
    }
  }
}
إعجابَين (2)

I wish I could give you 10 likes! Thank you so much, Don!

3 إعجابات

If you want to do this on multiple categories and avoid having many SCSS lines, you can use SCSS loops. It makes the code easier to read and maintain because you’ll just have to edit two SCSS variables.

4 إعجابات

I’m going to try to make this into a theme plugin, thanks for this loop idea!

4 إعجابات

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.