Hi! How is it possible to display a special icon or text above the post in the source theme when a post is featured? Similar to the casper theme for example? Does anyone have an idea? Thank you very much!
Yep. That theme writes a .featured class for featured posts, so you can use that as a âhandleâ to add something to those posts, as long as it can be accomplished with CSS. Hereâs a 10 second example:
article.gh-card.post.featured {
background-color: pink;
}
But you probably want something more like âŚ
article.gh-card.post.featured .gh-card-title::after {
content: " â"
}
Thank you! Works perfect!
But I have an additional question: I would like to have a different background color for all posts from a certain tag. Not on the homepage, but when the posts are opened (now the background for every post is white for example). Is that possible somehow?
So youâll want to inspect the page to see if thereâs a specific tag applied to those posts. If yes, the approach would be similar!
Can you give me an example? letâs just call the tag ânewsâ.
I just want that the posts which are included at this tag, have an other post-background.
Yes, it possible, add code into âsite headerâ through âCode injectionâ
<style>
.post-template.tag-news .gh-viewport {
background-color: lightblue;
}
</style>
Wow thank you! Perfect!