• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
Daily Blog Tips

Daily Blog Tips

How to make money from your blog

  • Home
  • Popular
  • Contributors
  • About
  • Contact / Advertise
  • Blogging
  • Marketing
  • Design
  • Money
  • Reviews
  • Productivity
  • Software
  • Technology

Now I See Why the WordPress Image Align Feature Was Not Working

By Daniel 72 Comments Reading Time: < 1 minute

There is one WordPress feature that was introduced with version 2.5 that always made me curious: the image alignment feature of the “Add media” editor. Why? Because it never worked!

Now I See Why the WordPress Image Align Feature Was Not Working Photo

I knew that I was probably doing something wrong, but since I didn’t have time to find it out, I just kept choosing “none” as the alignment, and then I would manually insert the right, left or center alignment attribute on the image tag.

Then last week when I was submitting one of my themes for the WordPress Themes Directory I got a message saying that since version 2.5 WordPress themes were required to have the following code on their stylesheet:

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

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

Duh! That is why the alignment feature was not working on my blogs, I never added that code! Now if you faced this problem in the past, now you know how to solve it.

Now I See Why the WordPress Image Align Feature Was Not Working Photo

About Daniel

Daniel Scocco is a programmer and entrepreneur located in São Paulo, Brazil. His first company, Online Profits, builds and manages websites in different niches. His second company, Kubic, specializes in developing mobile apps for the iOS and Android platforms.

Reader Interactions

Comments

  1. Avatar of NetbooksNetbooks says

    at

    Also having the same issue…I have that code but it is not aligning

    Reply
  2. Avatar of MohitMohit says

    at

    Where to place that code in blog stylesheet?

    Reply
  3. Avatar of TomTom says

    at

    Brilliant, thankyou so much!

    Reply
  4. Avatar of gadgetgadget says

    at

    Thanks for the tip but upon checking, my code is exactly the same as that – but it’s not aligning correctly?!

    Reply
  5. Avatar of David PDavid P says

    at

    May you live to be 1000 years old.

    Reply
  6. Avatar of DusibelloDusibello says

    at

    Style.css is a long, complicated file. This code presumably should go in a certain section?

    One of the posts above says to put in ‘on the content section’??

    Reply
  7. Avatar of PeterPeter says

    at

    OK, I don’t get it. Pasted the code in to the css file, updated, checked the images and set the second one to the right and – damn, still the same. What is it I’m missing here?

    Reply
  8. Avatar of Peter ButlerPeter Butler says

    at

    Gee, I would ahve thought the new big upgrade to 2.7 would have sorted this

    Reply
  9. Avatar of Clone HighClone High says

    at

    Thanks a ton, this is a life saver!

    Reply
  10. Avatar of TimTim says

    at

    THANK YOU SO MUCH FOR THIS.

    This was driving me insane.

    Reply
  11. Avatar of Sebastien PageSebastien Page says

    at

    Thank you for saving me a time. It’s been driving me nuts for an hour until I came across this post! Thanks

    Reply
  12. Avatar of Stefan WurzStefan Wurz says

    at

    Yeah, really I like this article. Thanks for this nice article

    Reply
  13. Avatar of AndyAndy says

    at

    Fantastic! I thought I was going mad after the upgrade to 2.6 on my blog none of the image alignment worked for new images in posts.
    You have saved me bacon. Cheers!

    Reply
  14. Avatar of SusanSusan says

    at

    thank you!

    Reply
  15. Avatar of DusibelloDusibello says

    at

    No joy here.

    Does the code need to be pasted into a certain section of the stylesheet file?

    Reply
  16. Avatar of Tobias GothTobias Goth says

    at

    Big Thanks! I was starting to think that my version of WordPress was bust, but you made me think other wise.

    Reply
  17. Avatar of SaeedSaeed says

    at

    I have used this code to align my images perfectly on my blog. However, in the RSS feed reader, e.g. Google Reader, they still don’t float properly. Has anyone else been having the same problem as well? If so, were you able to rectify it? Please share kindly!

    Reply
  18. Avatar of AvigailAvigail says

    at

    Hello,

    thank you for sharing. It works without any problems. I was driving me mad I thought that I can just use new wp themes, but just pasting the code into the stylesheet works!

    Avigail

    Reply
  19. Avatar of BloggerNewbieBloggerNewbie says

    at

    Daniel:

    big help! got any clues on the post at a future date feature? When I set a future date, the post goes out into never never land not to be seen ever again!

    Reply
  20. Avatar of KristenKristen says

    at

    OH THANK YOU! I have been so frustrated with this topic and just adding that code to my stylesheet automatically fixed my images.

    THANK YOU THANK YOU THANK YOU

    Reply
  21. Avatar of BenoBeno says

    at

    I was doing a Google search trying to find out why WordPress wasn’t doing the right thing by default and I came across this post.

    Thank you for sharing.

    Reply
  22. Avatar of SchrottpresseSchrottpresse says

    at

    Thank you very much for this solution, I really was confused with all of the align functions on the button bar, none of them working ^^

    Reply
  23. Avatar of BloggerNewbieBloggerNewbie says

    at

    Daniel:

    worked! (no surprise) Saved a ton of work! Sometimes I use scribefire which lets you position graphics a little better. It has it’s benefits and drawbacks.

    Thanks. Always helpful.

    Reply
  24. Avatar of CoderCoder says

    at

    I never had this problem..
    Don’t know why?! LOL

    Reply
  25. Avatar of خسروبیگیخسروبیگی says

    at

    Hello

    Thanks for your solution. I had this problem too and your post help me.

    Regards

    Reply
  26. Avatar of JodithJodith says

    at

    *nods* I just had to have that fight with my theme last week (when I finally updated to 2.6 from 2.3.1). Drove me crazy getting it figured out, but I finally got it in there and can now float my text around my images.

    And there was much rejoicing!

    Reply
  27. Avatar of Melodee PattersonMelodee Patterson says

    at

    I hate to say all those hours I spent figuring out how to align my graphics were a waste, but, doh!

    Thanks!

    Reply
  28. Avatar of BloggerNewbieBloggerNewbie says

    at

    Well No duh here cause it’s all news to me, except the part that the alignment never worked, too much of a newbie to even begin to know how to work on it. I’ll check it out and report back on my success (positive thinker) 🙂

    Reply
  29. Avatar of parisbparisb says

    at

    @Daniel: Thanks. I did try that immediately when I saw this tip. It still isn’t working though. Is there a specific part of the stylesheet it should go into? I’m still aligning my images manually 🙁

    Reply
  30. Avatar of pandupandu says

    at

    oh…gosh, i always find difficulties when aligning image on my blog. you’re really ‘the daily blog tipper’, man…muchos gracias!

    Reply
  31. Avatar of Daniel ScoccoDaniel Scocco says

    at

    @Parisb, open WordPress CP, then Design, then Theme Editor, then open style.css file. Place it there.

    Reply
  32. Avatar of parisbparisb says

    at

    I’m wondering where to place this too? I’m using the passionduo theme and the images aren’t aligning. Thanks for any help.

    Reply
  33. Avatar of EL LoccoEL Locco says

    at

    Yach, really I like this article. Thanks for this nice article 😀

    Reply
  34. Avatar of David HutchisonDavid Hutchison says

    at

    Thank you! There doesn’t seem to be a blogging question that can’t be answered by our supportive community – quietly working alone at home, yet I don’t feel isolated.

    Reply
  35. Avatar of MichelleMichelle says

    at

    Daniel, you’re an absolute star. I’ve been struggling with this issue for months!

    Reply
  36. Avatar of AriAri says

    at

    Thank you Daniel, it really helps.
    @ Annie, you need to put the code at stylesheet file of your theme on the content section.

    Reply
  37. Avatar of HillaryHillary says

    at

    Oh man!!! Thanks for sharing this, what a time-saver.

    Like you, I’ve been aligning my images manually. Lol!

    Reply
  38. Avatar of AllynAllyn says

    at

    OK, so I am the only one who does not know where in the stylesheet to put that code.
    does it matter where you put it?
    help!
    thanks,
    AL

    Reply
  39. Avatar of RickRick says

    at

    I actually caught this myself. I always compare the latest default theme with the previous one. That way I catch any theme updates I need to propagate to my theme (which is based on the default).

    Reply
  40. Avatar of AnnieAnnie says

    at

    AHA! That’s the problem! Thanks for sharing the proper code. Now, where exactly do I put it? I’m just beginning to learn about this stuff . . .

    Thanks!

    ~ AA

    Reply
  41. Avatar of Brad Blogging.com - Personal Blog Tips And Blog HelpBrad Blogging.com - Personal Blog Tips And Blog Help says

    at

    It was so annoying adding an “float:left;” to each one of my pictures.

    Thanks for the code!

    Reply
  42. Avatar of Todd AndrewsTodd Andrews says

    at

    Wow, I’ve been coding a work-around for this for a while now. They need to make this standard with all WP themes someday

    Reply
  43. Avatar of EllieEllie says

    at

    Thanks so much, that was an annoying problem.

    Reply
  44. Avatar of stetoscopestetoscope says

    at

    GREAT, I HAD THIS PROBLEM TOO.
    THANK YOU VERY MUCH

    (DO YOU HOW TO WRITE WITHOUT CAPS ;-)))

    Reply
  45. Avatar of Dean SalibaDean Saliba says

    at

    I had this same problem, thank you for the solution.

    Reply
  46. Avatar of DjFlushDjFlush says

    at

    lol and I kept thinking this was a problem with my blog only. Thanks Daniel! It works

    Reply
  47. Avatar of StephenStephen says

    at

    I better go check my theme’s stylesheet. Mahalo for the info.

    Reply
  48. Avatar of ArjenArjen says

    at

    Thanks! I’m going to add these code to my theme.. have been wondering why it wasn’t working!

    Reply
  49. Avatar of David LauDavid Lau says

    at

    Thanks, i got the same headache problem,and now it’s working~

    Reply
  50. Avatar of XIIIXIII says

    at

    Big doh moment, thanks for the tip. Me thinks WordPress themes seem to have a hard time keeping up with new WordPress features.

    Reply
Newer Comments »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Trending Today

Popular

  • 28 Ways to Make Money with Your Website 514 Comments
  • 43 Web Design Mistakes You Should Avoid 474 Comments
  • 4 Steps to Increase Your Blog Traffic 188 Comments
  • How to Find Advertisers for Your Website 126 Comments
  • Top 25 SEO Blogs 243 Comments
  • 101 Blog Tips I learned 177 Comments
  • 30 Traffic Generation Tips 351 Comments
  • 6 Ways to Speed Up Your Site 51 Comments
  • 9 Hacks to Show Readers Your Best Stuff 21 Comments
  • 50 Simple Ways to Gain RSS Subscribers 145 Comments
  • The Best Website Taglines 127 Comments
  • What Is Success? 57 Comments
  • How to setup a 301 Redirect 52 Comments
  • The 7 Characteristics of Good Domains 76 Comments
  • 7 Ways to Promote your Site 133 Comments
  • Top 25 Celebrity Blogs 44 Comments
  • What Is A Blog? 81 Comments
  • Blog Setup: 40 Practical Tips 57 Comments
  • 10 Tips To Write Your Most Popular Post 79 Comments
  • The Blog Post Checklist 75 Comments
  • Interview: 12 Top Online Entrepreneurs 98 Comments
  • What Is Bounce Rate? 42 Comments
  • 20 SEO Terms You Should Know 28 Comments
  • How To Choose A Blog Name 15 Comments
  • 10 Tips to Sell Your Website on Flippa 37 Comments
  • Top 25 Web Design Blogs 80 Comments

Online business done right. Take your marketing efforts to the next level with tips and resources to get visitors to your website.
As featured
CNBC copyblogger problogger Entrepreneur Lifehacker Hubspot Business Insider Wordpress Showcase
Privacy Policy| Terms of Service | About | Contact

777 Brickell Ave #500-14648, Miami, FL, 33131, US
DBT Logo
DBT is an independent website. The views expressed on this site may come from individual contributors and do not necessarily reflect the view of DBT or any other organization. All Content Copyright ©2006-2023. Daily Blog Tips unless otherwise noted or credited.