Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a problem with the wordpress editor. It keeps removing my enters and scrambling the content. How can I solve this problem?

Error in editor

share|improve this question
    
which version of wordpress you are using? –  Ramkumar Jun 30 '11 at 10:59
    
Last one (3.1.4). I always keep it up to date. –  Jarco Jun 30 '11 at 18:05

1 Answer 1

up vote 5 down vote accepted

I'd suggest using editor style for your wysiwyg. Add add_editor_style(); to your functions.php and then add a new file called editor-style.css to your main theme directory. Your editor style should reflect the basic css settings like your actual frontend content width, H1, H2, p etc tags styles, margins, image padding adn margins etc. Don't copy your default style.css, only the basic styling.

Here is an example of an editor-style.css file I used on my latest project (note html .mceContentBody):

html .mceContentBody {
width:690px;
font-family:Arial, Helvetica, sans-serif;
}

h1 {
    color: #AC2327;
    display: block;
    font-size: 16px;
    font-weight: bold;
    line-height: 50px;
}
h2 {
    color: #494949;
    font-size: 14px;
    font-weight: bold;
    margin: 10px 0 15px;
}
ul li {
    color: #494949;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.7em;
    list-style: disc inside url(includes/images/dot.gif);
    padding: 2px 0;
}
p {
    color: #494949;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.6em;
    margin: 15px 0 5px;
}
p a {
    color: #CA1016;
    text-decoration: none;
}
strong {
    font-weight: bold;
}
img {
    border: 1px solid #E4E2E2;
    clear: both;
    margin: 0 25px 25px;
}
hr {
    background-color: #D7D7D7;
    border: 0 none;
    color: #D7D7D7;
    float: left;
    height: 1px;
    margin: 0 0 18px;
    width: 100%;
}
share|improve this answer
    
Great. Exactly what I needed. Changing the how it is needed to resemble the front page. –  Jarco Jun 30 '11 at 18:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.