The MU forums have moved to WordPress.org

Image Alignment in Write Post and Write page (14 posts)

  1. maxwell67
    Member
    Posted 14 years ago #

    Hello all , I have to big issues with my WPMU 2.6.

    1. The Image Alignment in Write Post and Write page dose not work. whatever you do , the the image alignment dose not changes.

    2. In write page section and under the Advanced Options i have lost the Page Template and Page Author.

    Please advice ,

  2. andrea_r
    Moderator
    Posted 14 years ago #

    Check your theme.

  3. maxwell67
    Member
    Posted 14 years ago #

    The same theme am using is okay in my local host. The problem is that i don't get the Page template option under the post's advanced option ...
    I have even checked the same them with the same config in my local host and its works well..

    Any idea?

  4. dgilmour
    Member
    Posted 14 years ago #

    Check that the custom page template isn't missing or damaged on your 2.6 site.
    "In order to access the Page Template selector, there must be at least one custom Page Template available in the active theme..."
    http://codex.wordpress.org/Pages#Page_Templates

  5. maxwell67
    Member
    Posted 14 years ago #

    dgilmour !!!

    Thank you very much dear , fixed! I got back the page template option .

    I sill got the same problem with my pestos . The Image Alignment dose not work. It's was okay before upgrading from 1.5 to 2,6 . Any idea to fix it...

    Thank you very much

  6. keppy
    Member
    Posted 14 years ago #

    WP 2.6 changed the way image alignment is handled from previous versions. It happens in two different ways now. If you have typed in a caption for the image and assigned an alignment, then a wrapper div is now created with the classes wp-caption and alignright (or whatever alignment). Previous versions of wordpress would just put the caption in the <i>alt</i> attribute of the <img> tag. If the image doesn't have a caption then the <img> tag gets a class of alignright, alignleft, alignnone etc. just like previous versions of wordpress.

    So in summary, your theme needs to have the alignright, alignleft, alignnone, and aligncenter classes in the CSS file with the appropriate floats or margins in each class to format the images and divs correctly.

  7. maxwell67
    Member
    Posted 14 years ago #

    thank you keppy! In this case we need to change all of templates ? Do you any example WP theme ?

    Or nay css code ?

  8. maxwell67
    Member
    Posted 14 years ago #

    Well !
    I found this css and fixed the problem. Guys if you have problem with the Image Alignment in thewp 2.6 ... put the below code in the css. And thank you very much keppy fo ryour help...

    here is the link

    http://codex.wordpress.org/CSS

    And here is code :

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

    .alignleft {
    float: left;
    }

    .alignright {
    float: right;
    }

    .wp-caption {
    border: 1px solid #ddd;
    text-align: center;
    background-color: #f3f3f3;
    padding-top: 4px;
    margin: 10px;
    /* optional rounded corners for browsers that support it */
    -moz-border-radius: 3px;
    -khtml-border-radius: 3px;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    }

    .wp-caption img {
    margin: 0;
    padding: 0;
    border: 0 none;
    }

    .wp-caption p.wp-caption-text {
    font-size: 11px;
    line-height: 17px;
    padding: 0 4px 5px;
    margin: 0;
    }

  9. copperblade
    Member
    Posted 13 years ago #

    Hmmm, this doesn't work for me. No matter what I do, the editor won't "save" the class change. Even when in HTML mode, if I put in class="alignleft" it removes it. (i.e. after saving, it's gone)

  10. andrea_r
    Moderator
    Posted 13 years ago #

    The css above needs to go in the theme's style.css, not the post itself.

    And don't put the classes around the images - WP will just pick it up.

  11. tdjcbe
    Member
    Posted 13 years ago #

    If you don't want to add it to each theme, which is a pain, write up a small plugin that hooks into wp_head and adds in that code to each theme.

  12. copperblade
    Member
    Posted 13 years ago #

    andrea: I'm not sure what you mean. Even with the css in style.css or another imported stylesheet, the final product still needs to have a way of referencing that class. e.g. the <img> tag will have a class="alignleft" in it to reference what's in the stylesheet. class= would never be found in a stylesheet

    What I'm saying is that it never seems to save the part that belongs in the HTML. In other words, I'm confident that the stylesheet is fine as it does work magically when I add a caption. However, when aligning just an image the stuff that belongs in the actual post never gets saved correctly.

    tdjcbe: that's a great idea, hopefully all my themes call wp_head

    I am assuming there's something weird with my setup because I'm sure I wouldn't be alone in this problem otherwise.

  13. andrea_r
    Moderator
    Posted 13 years ago #

    Are you using the align left / right button in the image uploader?

    If so, and they still get stripped, check the kses.php file. you can add them in there.

  14. copperblade
    Member
    Posted 13 years ago #

    Ah, yes. I will check that. I hacked the kses stuff with a plugin. Thanks for the suggestion.

About this Topic

  • Started 14 years ago by maxwell67
  • Latest reply from copperblade