• Hi, I have just built my first working theme and am so excited. i am having a small issue regarding the text editor. it dosnt want to align images left or right.

    My 1st plan of attack was to copy the editor-style.css file from twentytwelve theme and link to in from my functions.php file like so

    // This theme styles the visual editor with editor-style.css to match the theme style.
    	add_editor_style('editor-style.css');

    but that didnt seem to work. The only way I could get it to work is to paste the following code into my main stylesheet style.css

    /* =WordPress Core
    -------------------------------------------------------------- */
    .alignnone {
        margin: 5px 20px 20px 0;
    }
    
    .aligncenter,
    div.aligncenter {
        display: block;
        margin: 5px auto 5px auto;
    }
    
    .alignright {
        float:right;
        margin: 5px 0 20px 20px;
    }
    
    .alignleft {
        float: left;
        margin: 5px 20px 20px 0;
    }
    
    .aligncenter {
        display: block;
        margin: 5px auto 5px auto;
    }
    
    a img.alignright {
        float: right;
        margin: 5px 0 20px 20px;
    }
    
    a img.alignnone {
        margin: 5px 20px 20px 0;
    }
    
    a img.alignleft {
        float: left;
        margin: 5px 20px 20px 0;
    }
    
    a img.aligncenter {
        display: block;
        margin-left: auto;
        margin-right: auto
    }
    
    .wp-caption {
        background: #fff;
        border: 1px solid #f0f0f0;
        max-width: 96%; /* Image does not overflow the content area */
        padding: 5px 3px 10px;
        text-align: center;
    }
    
    .wp-caption.alignnone {
        margin: 5px 20px 20px 0;
    }
    
    .wp-caption.alignleft {
        margin: 5px 20px 20px 0;
    }
    
    .wp-caption.alignright {
        margin: 5px 0 20px 20px;
    }
    
    .wp-caption img {
        border: 0 none;
        height: auto;
        margin: 0;
        max-width: 98.5%;
        padding: 0;
        width: auto;
    }
    
    .wp-caption p.wp-caption-text {
        font-size: 11px;
        line-height: 17px;
        margin: 0;
        padding: 0 4px 5px;
    }

    But surely there is a better way than this?

Viewing 16 replies (of 16 total)
Viewing 16 replies (of 16 total)
  • The topic ‘1st ever custom theme, but with issues?’ is closed to new replies.