By David Hannes.

WordPress Tutorial: Fixing Image Align Problems Recently one of my clients WordPress accounts incurred a glitch in aligning the image. Regardless of how my client configured each image using the WordPress control panel, and in spite of trying to patch the images with CSS, the images simply would not align properly. This was a problem.

Working with the client’s server provider, the administrator suggested that this bug may stem from the active theme being used and that the issue at hand was not the fault of the WordPress software. The hypothesis was a correct one.

I cross compared the source code of the page that was having issues with both the theme my client used and the default theme that comes with WordPress. What I discovered is that WordPress uses its own set of custom classes in order to align images. By default, WordPress expects to find the CSS classes “img.centered”, “img.alignright”, “img.alignleft”, “.alignright” “.alignleft” in every theme’s style sheet. If you use the WordPress software to configure alignment you may see any of the above classes assigned to the image in the source code.

HOWEVER…If you have an active theme installed that does not have these classes written into style.css, you too may incur a problem with your layout.

Note: the default template for WordPress; “WordPress Default 1.6” by Michael Heilemann, includes the file RTL Stylesheet (rtl.css). If you find that you are incurring a layout problem, you may wish to cut and paste specific code from rtl.css to your active theme’s style.css theme to insure that the missing CSS code is included without adversely affecting your active theme’s css.

NOTE: be sure not to overwrite code in your active theme’s css file with the default code as your theme developer may have intentionally developed css classes based on the default classes of the same name. Also, it is good practice to make a back up file of your active css theme before manipulating the stylesheet code. That’s just smart practice

Creative Developments is an all-purpose website development company. To inquire about our web design, video editing, internet marketing, SEO or social media management services for you or your business, call us at (480) 968-5096 or email us at dhannes@develop4u.com. We are located in Tempe, AZ, servicing Phoenix, Scottsdale, Paradise Valley, Mesa, Chandler, Glendale, Gilbert, the entire valley, Arizona and beyond.