shawa
2 ביולי, 2024, 4:14am
1
Hello everyone, I have a question: When creating a new post, is it possible to add color to the text in the title, as shown in the picture?
as shown in the image:
It’s possible to do in CSS with the attributes of topic’s “tr” tag. It has topic id, category & tag slugs, topic statuses, etc.
shawa
2 ביולי, 2024, 8:06am
3
How should I specifically operate? Are there any detailed tutorials?
shawa
2 ביולי, 2024, 8:46am
4
@Lhc_fl 大佬,帮我看看
Esteemed colleague, might I trouble you to cast your discerning eye over this matter?
Lhc_fl
(Linca)
2 ביולי, 2024, 9:12am
5
I need you to give more detailed information
Specifically, you did not explain the rules for coloring different topics with different colors.
For example, this will make the topic with id 314580 red.
tr[data-topic-id="314580"] td.topic-list-data .title {
color: red
}
shawa
2 ביולי, 2024, 9:17am
6
Thank you for your response. I wonder, where should this code be added or configured?
tr[data-topic-id="314580"] td.topic-list-data .title {
color: red
}
shawa
2 ביולי, 2024, 9:28am
8
I took a look, and the only theme with the custom CSS/HTML option deactivated is mine. Is this where I can set it up?
Also, how can I find the ID of a post? Is it the number at the end of each post?
shawa
2 ביולי, 2024, 10:02am
9
I don’t know why it’s not working. Is my code written correctly?
Obtained ID:
After refreshing the browser, the specified theme color for the ID remains unchanged.
Moin
2 ביולי, 2024, 10:06am
10
Does it work when you use the preview button?
shawa
2 ביולי, 2024, 10:11am
11
Hello, I tested the preview and the pop-up page still didn’t see the specified ID’s theme color change.
shawa
2 ביולי, 2024, 10:32am
12
I found that only the default theme has the “Edit CSS/HTML” option, other added themes do not have this option. However, even if I enable the default theme, the color of the title I modified still does not change. I’m not sure where I went wrong in the process.
Heliosurge
(Dan DeMontmorency)
2 ביולי, 2024, 7:01pm
13
This is quite handy as you could color title via cat/sub or tag.
Lhc_fl
(Linca)
3 ביולי, 2024, 12:17am
14
Because those themes you installed were pre-written by others and cannot be modified
The solution is to try to create a theme component and then include it in your enabled theme
Create a theme component and add it using this:
shawa
3 ביולי, 2024, 2:13am
15
Hello, I tried creating a new theme test. However, whether it is previewing the theme or switching to this theme, the title color of the corresponding ID still has not changed at all. I don’t know where else I need to make adjustments.
Lhc_fl
(Linca)
3 ביולי, 2024, 2:18am
16
Then try adding the !important flag
tr[data-topic-id="51"] td.topic-list-data .title {
color: red !important;
}
shawa
3 ביולי, 2024, 2:29am
17
Wow! Instantly effective, you’re amazing!
Wow! It works instantly, you’re amazing!
Is it because the priority is not enough?
Lhc_fl
(Linca)
3 ביולי, 2024, 2:33am
18
Yes, I’m too lazy to see where the CSS has taken effect.