shawa
2 juli 2024 om 04:14
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 juli 2024 om 08:06
3
How should I specifically operate? Are there any detailed tutorials?
shawa
2 juli 2024 om 08:46
4
@Lhc_fl 大佬,帮我看看
Esteemed colleague, might I trouble you to cast your discerning eye over this matter?
Lhc_fl
(Linca)
2 juli 2024 om 09:12
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 juli 2024 om 09:17
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 juli 2024 om 09:28
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 juli 2024 om 10:02
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 juli 2024 om 10:06
10
Does it work when you use the preview button?
shawa
2 juli 2024 om 10:11
11
Hello, I tested the preview and the pop-up page still didn’t see the specified ID’s theme color change.
shawa
2 juli 2024 om 10:32
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 juli 2024 om 19:01
13
This is quite handy as you could color title via cat/sub or tag.
Lhc_fl
(Linca)
3 juli 2024 om 00:17
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 juli 2024 om 02:13
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 juli 2024 om 02:18
16
Then try adding the !important flag
tr[data-topic-id="51"] td.topic-list-data .title {
color: red !important;
}
shawa
3 juli 2024 om 02:29
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 juli 2024 om 02:33
18
Yes, I’m too lazy to see where the CSS has taken effect.