Results 1 to 4 of 4

Thread: Wordpress image locator fix

  1. #1
    Member Needs New Keyboard Array the goat's Avatar
    Join Date
    Aug 2008
    Location
    Beantown
    Posts
    167

    Default Wordpress image locator fix

    So I have a couple of sites where the image locator in posts just never worked for me, they were always on the left side unless I put my own html commands in. (which was hugely annoying because if I ever switched out of html they would disappear) I had been looking for the fix for a while and I finally came across what I was looking for. I thought I would share it in case anyone else was having the same frustrations.

    I simply added this to my .css file and it now works like a charm:

    img.centered, .aligncenter, div.aligncenter {
    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;
    }

  2. #2
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,488

    Default

    The problem was likely theme related then. All those classes are part of the default WordPress theme and I guess that's how the image locator sets things. Good to know. I usually use floatright, floatleft or just right and left in my css, but in themes I'm going to stick with alignright, alignleft, etc just to not break someone's posts.
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

  3. #3
    Member Needs New Keyboard Array the goat's Avatar
    Join Date
    Aug 2008
    Location
    Beantown
    Posts
    167

    Default

    Yeah not sure why anyone would remove that for a theme. Of the last five I have used, the image locator didn't work with four of them and I had to put that in there.

  4. #4
    Post Impressionist Array vangogh's Avatar
    Join Date
    Aug 2008
    Location
    Boulder, Colorado
    Posts
    13,488

    Default

    The problem is that the image locator shouldn't be tied to those classes. Most coders will have their own name for the classes. alignleft wouldn't be my first choice or at least hasn't been in the past. I've used left and floatleft to do the same thing. The align part is how WordPress has done things, but the functionality really shouldn't be tied to any specific class name.
    l Search Engine Friendly Web Design | Vanseo Design
    l Design, Development, Marketing, and SEO Tutorials | Steven Bradley's Notebook
    l Custom WordPress Themes |Get my book about Design Fundamentals

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •