Centering Titles / Uncentering in Sidebar for WordPress theme

Hi Aigars,

Hi,

I’ve been using html coding to center the title of each post, and that works well. However, the titles in the sidebar become centered as well, which I don’t want. Is there a way to change that?

I see that you have already figured out how to center titles inside post content.

Another solution would be to use CSS like this via Appearance >> Theme Options >> Other >> Custom CSS.

#primary h3 {
  text-align: center;
}

You can do the same thing with other titles such as h1, h2, h4, etc and it will target only primary content area and not widget area which is marked as #secondary.

Let me know if you need any further assistance with this.

Hi Aigars,

Unfortunately, that didn’t work. I can not see that anything happened. The titles are still off to the left, not centered, using

#primary h3 {
  text-align: center;
}

Like I said, you have to apply this for all h1, h2, h3 etc tags. That was just a general example.

To align post title which is above content you can use code like this:

#primary .entry-title {
    text-align: center;
}

Thank you, thank you, thank you!

That last code worked perfectly. That’s exactly what I was wanting. The post titles are now centered, but the sidebar titles are not. :slight_smile:

Please can you tell me how I can centre my logo

colourthreadinteriordesign.com

Thanks!!

@colourthread

This thread is related to a completely different topic. Please start your own thread and I will try to help you from there.