- This topic has 7 replies, 2 voices, and was last updated 8 years, 8 months ago by
Tom.
-
AuthorPosts
-
January 13, 2015 at 1:00 am #64588
Tobias Hjorth
Hi all
I have a question that puzzles me. Is it possible to change the post header background color on each and every single post on the blog roll?
Thanks
January 13, 2015 at 7:58 am #64668Tom
Lead DeveloperLead DeveloperHi Tobias,
You can accomplish this using CSS.
Each post has a unique ID which you can find by inspecting the “article” element using Chrome’s developer tools (inspect element).
Once you find the unique ID, you can use it in the CSS to apply specific attributes to each post.
Let me know if this makes sense or not π
January 13, 2015 at 1:09 pm #64774Tobias Hjorth
Hi Tom
Thanks again for your prompt answer!
I don’t mean to sound lazy but I really do not know how to code CSS. Although I think I can find each ID they all have to be the same – Not too sure really..I know this is probably besides what you would call regular support for your theme so if anyone could chime in on what I should write if I would like the background color to be #222222 and the headline to White #ffffff what would I add in CSS?
Again thank a million to Tom and anyone looking π
January 13, 2015 at 8:00 pm #64847Tom
Lead DeveloperLead DeveloperI misunderstood your question – I thought you wanted to single out specific posts.
If you want to do this to all posts, you can do something like this:
article.post .entry-header { background: #222; padding: 20px; } article.post .entry-header h2 a, article.post .entry-header h2 a:visited { color: #FFF; } article.post .entry-header h2 a:hover { color: #fafafa; /* color on mouseover */ }
January 14, 2015 at 4:09 am #64934Tobias Hjorth
Thank million Tom that’s exactly what I’m looking for. Now if it possible can I have the now grey header without margin to the sides and top? If I remove content margins it does that but also remove margins for the rest of each and every post.
If I were to do same the on the Widget boxes am I right in just replaceing the above article.post with article.widget and copy anything else?
Again you’re a great help and this is by far the greatest WP theme.
January 15, 2015 at 1:28 pm #65499Tom
Lead DeveloperLead DeveloperYou can work against the content padding like this:
article.post .entry-header { margin: -40px -40px 20px -40px; }
That assumes your content padding is set to 40px.
Widgets don’t have the same headers – you can alter that like this:
.widget-title { /* stuff in here */ }
January 18, 2015 at 10:12 am #66483Tobias Hjorth
Thanks Again Tom. That is exactly what I wanted. π
January 18, 2015 at 3:35 pm #66529Tom
Lead DeveloperLead DeveloperYou’re welcome π
-
AuthorPosts
- You must be logged in to reply to this topic.