WordPress.org

Ready to get started?Download WordPress

Forums

image align left or right randomly not working (16 posts)

  1. nmarcisso
    Member
    Posted 4 years ago #

    For some reason the image alight left or right is randomly working some images and posts and not others.

    Example of it working:
    http://easternslopes.com/2010/01/05/okemo’s-ross-powers-superpipe-opens/

    Example of it not working:
    http://easternslopes.com/2010/01/05/enquiries-into-the-art-of-snowboarding-part-1/

    Both images are placed in the same spot (before the paragraph).

    This is an issue that just started happening in 2.9.1 that i know off. We have been using WordPress since 2.8 and never had an issue till now.

  2. The second image is missing alignleft (or right) CSS code.

    <img class="size-medium wp-image-2648 " title="NightBoarder" src="http://easternslopes.com/wp-content/uploads/2010/01/NightBoarder-300x214.jpg" alt="" width="300" height="214" />

    See what's in the class value?

    In the other one you have this:
    <img class="size-medium wp-image-2683 alignright" title="superpipe ross" src="http://easternslopes.com/wp-content/uploads/2010/01/superpipe-ross-300x199.jpg" alt="" width="300" height="199" />

    When you insert an image, you get the option for align left, right, center or none. You must have clicked none :)

  3. nmarcisso
    Member
    Posted 4 years ago #

    No i did, this is the problem. I have it selected and in the preview it works but when i publish it doesn't work. The caption doesn't seem to be working either.

  4. vtxyzzy
    Member
    Posted 4 years ago #

    Are you selecting 'alignleft' or 'alignright' randomly with code? If so, can you post a snippet with that code?

  5. nmarcisso
    Member
    Posted 4 years ago #

    [caption id="attachment_2648" align="alignright" width="300" caption="A remarkable discovery: a snowboarder surfs down the brightly lit slopes of Pats Peak on a winter's night. (Pats Peak photo)"]<img class="size-medium wp-image-2648" title="NightBoarder" src="http://easternslopes.com/wp-content/uploads/2010/01/NightBoarder-300x214.jpg" alt="" width="300" height="214" />[/caption]

    This is what is inserted when i do insert into post. as Ipstenu says alignright is not in the img class, but i have made sure multiple times that is selected. When i manually enter it, it works but my caption then doesn't work.

    Could this be a bug?

  6. vtxyzzy
    Member
    Posted 4 years ago #

    It could be, but I cannot say for sure. Sorry I can't help on this one.

  7. nmarcisso
    Member
    Posted 4 years ago #

    I have opened a ticket, just in case:
    http://core.trac.wordpress.org/ticket/11797

  8. (FYI, but backticks around your code next time, see the hint below the text box here)

    Interesting! It's the caption. And it's kind of intentional, except not really.

    I just did this:

    With caption
    [caption id="attachment_2171" align="alignright" width="100" caption="dgfsdaf"]<a href="http://mydomain.com/blog/2010/01/internalcombustion.jpg"><img src="http://mydomain.com/blog/2010/01/internalcombustion.jpg" alt="" title="internalcombustion" width="100" height="100" class="size-thumbnail wp-image-2171" /></a>[/caption]

    Without caption
    <a href="http://mydomain.com/blog/2010/01/internalcombustion.jpg"><img src="http://mydomain.com/blog/2010/01/internalcombustion.jpg" alt="" title="internalcombustion" width="100" height="100" class="alignright size-thumbnail wp-image-2171" /></a>

    When the caption renders HTML, it wraps my image with a <div> that has the alignwhatever class in it. Now interestingly, for me, either way it works. I went back to your page to see if yours did too.

    The source code for the nightboarder image is this:
    <a href="http://easternslopes.com/wp-content/uploads/2010/01/NightBoarder.jpg"><img class="size-medium wp-image-2648 " title="NightBoarder" src="http://easternslopes.com/wp-content/uploads/2010/01/NightBoarder-300x214.jpg" alt="" width="300" height="214" /></a>

    That's it. The caption div doesn't show up, even though you put the code in!

    [caption id="attachment_2648" align="alignright" width="300" caption="A remarkable discovery: a snowboarder surfs down the brightly lit slopes of Pats Peak on a winter's night. (Pats Peak photo)"]<img class="size-medium wp-image-2648" title="NightBoarder" src="http://easternslopes.com/wp-content/uploads/2010/01/NightBoarder-300x214.jpg" alt="" width="300" height="214" />[/caption]

    Advice 1: Upgrade to 2.9.1
    Advice 2: If you already did that, reupload the files, something's not rendering right.
    Advice 3: Did that? Okay, try the default theme. Maybe something in your theme is stripping the caption divs.

  9. nmarcisso
    Member
    Posted 4 years ago #

    See that is what i noticed when i did it. Like i said before though, sometimes it works other times it doesn't. I have tried it with another theme and the same thing happens.

    This post was made after the one that doesn't work and it works just fine.
    http://easternslopes.com/2010/01/05/okemo’s-ross-powers-superpipe-opens/

  10. There's something buggered with either WP or that post.

    I'd reupload all my WP core files.

  11. nmarcisso
    Member
    Posted 4 years ago #

    Is anyone else having this problem or am i the only one?

  12. ebertcom
    Member
    Posted 4 years ago #

    Did you ever find an answer? I have the same thing going on and it's across the board. WHile the image shows up in the original pane just fine, when I preview or post, it never right aligns. It's in the html coding when I create it, and when I check the page source, I see the alignright as well but it's not aligning at all.

  13. mattneedshelp
    Member
    Posted 4 years ago #

    I am having this same problem. with wordpress 2.9.1 and elements of SEO theme even with an updated syle.css

  14. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    @ebertcom and @mattneedshelp:
    a link to your site would help.

    @ebertcom:
    sounds more like the styles for the alignment are not in your style.css.
    check if you can find these or similar in the style.css file of your theme:

    /*	Using 'class="alignright"' on an image will (who would've
    	thought?!) align the image to the right. And using 'class="centered',
    	will of course center the image. This is much better than using
    	align="center", being much more futureproof (and valid) */
    
    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;
    	}
    /* End Images */

    if not, simply add them to the end of style.css.

  15. mattneedshelp
    Member
    Posted 4 years ago #

    okay guys my problem was fixed by changing this bit of code in my style.css

    #content p img{
    	float: left;
    	border: none;
    	margin-right: 15px;
    	margin-bottom: 10px;
    	padding-top: 7px;
    	}

    i just removed the float: left;

    see if you see this in your style.css and make the changes.

  16. nmarcisso
    Member
    Posted 4 years ago #

    I have figured out the issue to be with this plugin "WordPress Keyword Link Plugin" Since this plugin was designed before captions were implemented, it does not omit them from auto linking. If you use a keyword you have defined in the program it will attempt to insert it but will break the caption short code.

    That is what cause the issue i originally reported.

Topic Closed

This topic has been closed to new replies.

About this Topic