Fixing image align issue in your WP theme

Posted on Sunday, 1 February 2015

Fixing image align issue in your WP theme

Are you looking for a reliable animation partner? - Sundstedt Animation

The current theme have had an issue with aligning images, they have appeared to the left when inserting them. The CSS is missing class for aligncenter.

This theme lacked the align functionality so center tag was used before. Center tags are deprecated, so you should avoid using them!

One fix to align an image is using text-align:center, which works:

farm-blog-post-image

That was done manually though, so not very good.

So we went ahead and added missing class for aligncenter at the bottom of our CSS:

.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}

Then, we inserted the image again, using the WP Text Editor:

aligncenter

Not working either in our theme.

So, after no luck with aligncenter, we spent some time on the Google and simply added this at the bottom of the themes style.css:

p.pic {
text-align: center;
margin: 0 auto;
}

Then when you insert an image using p class=”pic” then it works.

alt

We do need to manually add the p class=”pic” and /p but it’s pretty simple.

Now if anyone else had this problem with your WP theme, and like us are not very experienced in CSS, perhaps you will be helped by this post!

Sundstedt Animation explainers and music video makers

Ready to partner?

    Ready to partner with a multi-award-winning, freelance, self-employed animator based in Scotland, UK? Anders doesn't work with just anyone. You have four easy options on how to get in touch::

    1. Please fill out the simple form below and we’ll follow up.
    2. Call Anders: +44 7531 800 711 to discuss your project.
    3. Chat with Anders in the lower right corner on this page.
    4. Email Anders with project details at hello@sundstedt.co.uk.

    Anders can help you create captivating animated videos that engage your audience and grow your business. Let's bring your ideas to life!

    Your name*

    Your email*

    Your website

    How can we help? Details please!*

      Yes, please subscribe me to the newsletter.

      I agree for this information to be used to respond to my enquiry. *

    * Indicates Required

    Please prove you are human by selecting the tree.

    Sundstedt Animation

    22 Auldlea Gardens
    Beith KA15 2EP
    Scotland, United Kingdom
    +44 7531 800 711

    Call Anders To Get Started!

    What most people do is complete the form above. We can then follow up, get you booked in for a free consultation and provide you with a free quote.

    Want to know more about our animated video services? Please have a look at these pages for more information:

    Services – What We Do
    Animation & Whiteboard Portfolio
    Animated Music Video Production Service
    Lyric Video Production Service
    Explainer Video Production Service
    Healthcare, Biotech, Medical & Pharmaceutical Animation
    Corporate Video Production Service
    Non-Profit Explainer Video Service
    Social Media Animation
    VideoScribe Video Production Service
    Whiteboard Animation Service
    2.5D Parallax 3D Effect Animated Photo Service
    Animated Infographics
    Book Trailer Video Service – Animated Book Trailers
    Title Sequence Design Service
    Professional Video Skin Retouch Service
    Animated Illustration / Animated Loop
    2D Paper Animation
    One-to-one advice, consulting and training
    Sponsorship & Partners

    Back To Top

    How useful was this post?

    Click on a star to rate it!

    Average rating 0 / 5. Vote count: 0

    No votes so far! Be the first to rate this post.

    We are sorry that this post was not useful for you!

    Let us improve this post!

    Tell us how we can improve this post?

    Don`t copy text!