WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am editing the 'Bizz' portfolio Wordpress theme(http://www.wpexplorer.com/bizz-wordpress-theme). It includes custom post types for managing portfolio examples, the highlights on the homepage, etc.

I want to style the background color displayed behind each 'highlights' heading with a different color, but since they're served dynamically, I'm not sure how I should target each h2.

Would it be best to attach a unique class to each of the three headings through the php, or try to target them through CSS selectors? And how would I best do that?

My major concern in using CSS selectors would be backward compatibility, I dont know that I want to bulk up the page with extra bootstraps.

How should I go about it? Thanks!

share|improve this question
up vote -1 down vote accepted

I think it depends on whether you want it to be unique for each of the four "highlighted" project columns on the homepage, or whether you want each "highlighted project" to be different.

Does that make sense?

E.g. if you just want each of the four project "columns" on the homepage to look different then I'd use CSS to achieve this : nth-of-type perhaps.

But if you wanted Project A (when highlighted on the homepage) to have a unique background colour regardless of what column it appears in, then Id use PHP to add the post->ID as a class in addition to portfolio-item and then use CSS to style that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.