How to Set Different Text Colors for Each Category Globally in Flex Blocks

Posted in: Newspaper
Post count: 39

Hello,

I’m using the Newspaper theme with Flex Blocks 1, and I have 15 categories. I would like to assign a unique text color to each category and ensure these colors are applied consistently wherever the categories appear (e.g., posts, archive pages, Flex Blocks, etc.).

Could you please guide me on how to achieve this? Specifically:
1. Is there an option in the theme settings to assign individual colors to categories globally?
2. If custom CSS is required, could you provide an example of how to target each category?

Thank you for your assistance!

Post count: 27744

Hi,

To set a specific color for each category, if it is so, then you can use a custom CSS like this one => https://www.screencast.com/t/WLgD2hJNMWN3
This is the code

.td-module-image a[href$="/music/"], .td-meta-info-container a[href$="/music/"], .td-module-container a[href$="/music/"], .single .td-category a[href$="/music/"], .tdb_single_categories a[href$="/music/"] {
background-color: green;
}
.td-module-image a[href$="/architecture/"], .td-meta-info-container a[href$="/architecture/"], .td-module-container a[href$="/architecture/"], .single .td-category a[href$="/architecture/"], .tdb_single_categories a[href$="/architecture/"] {
background-color: red;
}
.td-module-image a[href$="/video/"], .td-meta-info-container a[href$="/video/"], .td-module-container a[href$="/video/"], .single .td-category a[href$="/video/"], .tdb_single_categories a[href$="/video/"] {
background-color: blue;
}
.td-module-image a[href$="/architecture/"], .td-meta-info-container a[href$="/architecture/"], .td-module-container a[href$="/architecture/"], .single .td-category a[href$="/architecture/"], .tdb_single_categories a[href$="/architecture/"] {
background-color: red;
}

You need to change the category with your category (example: art with music) and also, you can change the color.
Set the code in Theme Panel ->Custom code -> Custom CSS -> https://www.screencast.com/t/St204VtFl3NU

Thank you!

Post count: 39

Fixed. Thank you so much!

However, I have another issue. My Flex Block 1 category filter isn’t working correctly. I have a category called “Formación,” but when I filter it, the block displays another category called “Audiencia” instead. “Audiencia” is a separate main category and is not a subcategory of “Formación.”

Post count: 39

please check this link https://imgur.com/a/hDCN7lI

Post count: 39

Every category is working fine except for one, which is causing that issue on some Flex Blocks that are filtered by another category. please check the attached

View post on imgur.com

  • This reply was modified 1 year by moss8007.
Post count: 39

Is there an option to make the filter work only for parent categories, excluding subcategories?

Post count: 27744

Hello,

Do you have this issue with the category template?
For each category, on the flex block there is a special filter for the current category, which dynamically displays the posts from that category within each category.
The Posts Loop automatically filters the posts depending on the cloud template you set (for example, on the category page, there will be posted posts from that category) https://forum.tagdiv.com/posts-loop/

Thank you!

Post count: 39

Hello,

I’m experiencing an issue with category filtering in the Flex Block. In my blog, one article is assigned to multiple categories. However, when I filter the Flex Block by a specific category ID, the expected category does not appear in the output. Instead, another assigned category from the same article is displayed.

Could you please help me resolve this issue? I want the output to strictly follow the selected category ID.

Post count: 27744

Hi,

Can you please provide a screenshot or a video with your settings?

Thank you!

Post count: 39

Hello,

Please see the attached image.https://imgur.com/a/hDCN7lI

I added the FORMACIÓN category, but in the output, it is displaying AUDIENCIA instead.

I want the output to show only FORMACIÓN and not other categories. (Note: The AUDIENCIA article is also assigned to FORMACIÓN and other categories.)

Could you please help me fix this issue?

Thank you!

Post count: 27744

Hi,

Please get in touch with us via email at contact@tagdiv.com and provide the wp-admin access.

Thank you!

Post count: 39

Hello,

I noticed that when I remove AUDIENCIA and other categories from the article, leaving only FORMACIÓN, the filtering works correctly. However, this is not a viable solution.

The issue occurs when an article is assigned to multiple categories.

Is there a way to ensure that only the filter-selected category is displayed in the output, regardless of other categories assigned to the article?

Looking forward to your assistance.

Post count: 27744

Hello,

If you have set many categories there, then the filter works well. Only the category is displayed in alphabetical order. You can set this there -> https://prnt.sc/eiTfxlJm1ckRand. In this way, only the primary category is displayed there on the block https://forum.tagdiv.com/primary-category/

Thank you!

Post count: 39

Hello,
The code you provided is working properly for all the mentioned categories, and the overlay color appears correctly. However, I have another Flex Block that displays “All Categories” with a “Most Popular” filter.
The problem is that the overlay works for specific categories, but it does not apply to the “Most Popular” Flex Block.
Could you please help me resolve this issue so the overlay color works on all posts, including those under the “Most Popular” flex block section?
Thank you for your support!

Here’s the code you gave me

.td-module-image a[href$=”/music/”], .td-meta-info-container a[href$=”/music/”], .td-module-container a[href$=”/music/”], .single .td-category a[href$=”/music/”], .tdb_single_categories a[href$=”/music/”] {
background-color: green;
}
.td-module-image a[href$=”/architecture/”], .td-meta-info-container a[href$=”/architecture/”], .td-module-container a[href$=”/architecture/”], .single .td-category a[href$=”/architecture/”], .tdb_single_categories a[href$=”/architecture/”] {
background-color: red;
}
.td-module-image a[href$=”/video/”], .td-meta-info-container a[href$=”/video/”], .td-module-container a[href$=”/video/”], .single .td-category a[href$=”/video/”], .tdb_single_categories a[href$=”/video/”] {
background-color: blue;
}
.td-module-image a[href$=”/architecture/”], .td-meta-info-container a[href$=”/architecture/”], .td-module-container a[href$=”/architecture/”], .single .td-category a[href$=”/architecture/”], .tdb_single_categories a[href$=”/architecture/”] {
background-color: red;
}

Please see the attached

View post on imgur.com

View post on imgur.com

  • This reply was modified 1 year by moss8007.
Post count: 27744

Hello,

Please provide the link to your website. Please check if you don’t have set here the color overlay on the blocks https://i.imgur.com/7VL6s7u.jpeg

Thank you!

Post count: 39

Hello,

Here’s the link https://test.laboratoriodeperiodismo.org/

I also would like to know if the TagDiv theme has a built-in system to display only the first selected category for a post. If multiple categories are assigned, can the theme automatically show only the first one, or is there a way to prioritize categories?

Post count: 39

Besides displaying only the first selected category, I’d like to know if the theme allows me to specify a particular category tag to be displayed when multiple categories are assigned.

Post count: 27744

Hello,

You need to set the primary category there, which will be displayed on the block. https://i.imgur.com/NhgE24W.png
I see that you have set the color custom on the images https://i.imgur.com/Zessg79.png you need to check if you have an extra class on the blocks.

Thank you!

Post count: 39

Hi, the primary category issue is resolved now, thank you. I have another question:

I would like to export a page from my current TagDiv Newspaper website to a new website that is also using the TagDiv theme. Is there an option to download or export the template of a page, and then import it into the new website to maintain the same layout and design?

Post count: 27744

Hi,

Using the import/export option from the theme will allow you to import only the theme panel settings, the cloud templates go in tool > export – https://i.imgur.com/3Wxk885.png then to import you need to go in tool > import then install the wordpress importer and click on run import – https://i.imgur.com/tyxoVvg.png

Thank you!

Viewing 20 posts - 1 through 20 (of 20 total)
The forum ‘Newspaper’ is closed to new topics and replies.