0

Hi I am new to Wordpress development and I have learned a lot already but I do not understand why the text and content in the pages and posts does not keep the format that the user sets in the back-end editor for posts or pages. And everything looks like a mess, formatting goes wild and it does not resemble the editor version at all. What am I missing in my code? I don't understand what is wrong, is it my css rules?

A funny thing is that when I change to another theme, the formatting does remain in place. And it seems to work with any theme available in the wordpress themes section.

Please help.

1
  • Hi! It sounds like unbalanced tags maybe? Have a look at your theme files and make sure every single tag that needs to close is being closed...
    – nibnut
    Commented Jan 20, 2017 at 20:12

2 Answers 2

0

Themes can optionally use TinyMCE editor stylesheets via add_editor_style(). If properly implemented, editor styles will do a pretty good job at making the contents of the editor look the same way as content rendered on the front end of the site.

Without editor styles, TinyMCE will use very basic styles which will not match the theme's design.

2
  • As I understand you use same rules for the editor as the rules you use for your theme front end. Is that correct? Thanks I'll check it out.
    – palmaone
    Commented Jan 21, 2017 at 2:05
  • Yes, that's right. Glad you solved the issue! Commented Jan 21, 2017 at 8:32
0

I found the solution for my problem:

I had disabled automatic paragraph and and line break tags generation in the visual editor, namely the wpautop function. So this made everything a mess, all the text would pilled up in front or after the content next to it, until the line had no more space for more content.

For further reference please check:

Thanks everyone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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