Article suggestions
  1. Home
  2. Section: Developer Hub
  3. Using CSS to Target Featured Posts

Using CSS to Target Featured Posts

Using CSS to Target Featured Posts
  • avatar
Written by Chan Nier
Updated on February 19, 2025

 Link: https://support.brilliantdirectories.com/support/solutions/articles/12000101382

Previously to edit the look of Pinned featured posts, complicated PHP in specific areas of code was required.

Now we've made it easier to control by including a class to featured posts for each post type.

This CSS Class will allow targeting Featured posts for each post type:

Here are two examples for 2 different post types:

With this class it will be easier to target the featured posts using CSS in the Design Settings rather than having to go into specific sections of the code and use PHP every time.

Example Using the CSS Method

After setting a post as featured as shown below:

In this example will change the Background Color of the post on the search results page with the CSS code below:

.featured-post, .featured-post .img_section, .featured-post .mid_section, .featured-post .grid_element {
    background-color: aliceblue;
}
CSS

After applying the CSS, the featured post will show with a different background color:


Thank you for leaving a rating!
Did you find this article helpful?
0 out of 0 people found this article helpful so far
Can't find what you're looking for? Get in touch
How can we help?
Send your question below and we'll get back to you as soon as possible.
Cancel
translation missing: en.kb.default.contact_form_error
×
Thanks for your message!
Thanks for your message!
×