How do I center the featured image in a Post. Currently, the image aligns to the left side of the column. Due to the variety of image sizes, it would look better on my site to have the image centered in the post.
I inserted this code into my Child Theme Stylesheet and it did the trick. Whether this is the best solution, I am not sure but it seems to work so far.
img.wp-post-image {
max-width: 100%;
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
display: inherit;
margin:0 auto;
z-index:5;
}
Actually…I just looked at the source code on my local test site after testing a smaller image. Not sure what happened but before it was working…however, the image is loading outside of its container which is why it’s not centering. I have to fix this.