Customise design for blog posts

Author Posts

laucocos

Hello,

I would like to set a custom design to apply to all my blog posts. For example, I would like the titles centred, increased line height and extra padding between sections. I would like this style to apply consistently across all posts but not pages.

I have looked in the settings and cannot see an option for this.

Could you advise whether this is possible and how I can do it?

Any help would be much appreciated.

Best,
Laura


Sebastian

Hi Laura,

If you could send me a link to your site I can advise you more specifically. But for now, I can say that tapping into the classes WordPress adds to the HTML body tag is probably the way forward. Among the various classes there, there might be a .post-single class, or something similar, which is only present on single blog posts – not pages. And so if you prefix your Microthemer selectors with this class it will limit them to single posts e.g.

.single-post h1

.single-post section

Alternatively, if you want to style collections of posts in the category view, you would look for a category class to include e.g.

.category-news .post

.blog-home .post

You can manually change the CSS selectors Microthemer generates via the edit icon in the Selectors menu at the top left (visible when hovering over a selector). Or by clicking the current selector’s name in the top toolbar.

Cheers,
Sebastian


laucocos

Hi Sebastian,

Thanks for your response. I can see a class called ‘entry-content’ which seems to apply to the body text and ‘entry-title’ which seems to apply to the title. I tried applying this and it worked for the blog, but it also applied to the pages too. I cannot seem to find any blog–specific tags.

Here is a link to my site: https://www.inspiratti.com/ You can access the blog posts from here: https://www.inspiratti.com/blog/

If you could help, I’d really appreciate it.

Best,
Laura


Sebastian

Hi Laura,

The entry-content and entry-title classes you found are nearby the elements you want to style. But I was actually recommending looking at the classes added to the HTML body tag, which WordPress often adds. The following video shows how to find and use these body classes.

http://somup.com/cFh3QZVHbl

(I forgot to mention in the video that you can use the Ctrl+F keyboard shortcut to search the HTML pane in targeting mode)

Looking at your site, I can see that your theme also adds the class to the body tag, so you can use method. Note, my code example above initially used .post-single rather than .single-post, but I’ve updated it now.

Cheers,
Sebastian


laucocos

This works perfectly – thank you.

Best wishes,
Laura

You must login or register to reply to this topic.