0

I've disabled visual editor, so this can't be an issue with switching between the two different editors as I've seen in many questions related to this same issue.

I'm pasting code into the page like:

<li>Something</li><li>Something</li><li>Something</li><li>Something</li>

When I save it, this is how it appears in the editor.

When I view the page, line breaks. I've confirmed by viewing the source that it's rendering:

<li>Something</li>
<li>Something</li>
<li>Something</li>
<li>Something</li>

When I go back into the editor, it still appears on a single line, but somewhere WordPress is messing with my code (probably around the same time it's removing my <p> tags) and it's very frustrating. How can I get it to stop doing this?

I'm using twentyfourteen as my base theme so maybe there's something in the theme causing this behavior. This is only my second week using WordPress so I don't have an answer for that one.

Edit: So I've been trying different methods of altering the html to get rid of inline-block white-space bug and just came across another WordPress curiosity.

When trying something like:

<li>Something</li><!--
--><li>Something</li><!--
--><li>Something</li><!--
--><li>Something</li>

Which is another way to get rid of this error. Wordpress renders:

<li>Something</li>
<p>
    <!--<br />-->
</p>
<li>Something</li>
<p>
    <!--<br />-->
</p>
<li>Something</li>
<p>
    <!--<br />-->
</p>
<li>Something</li>

Did Wordpress just have some kind of mental breakdown? Surely it can't be so stupid that it doesn't even realize that a) it would be ridiculous to alter the code to that and b) you can't even have <p> as direct children of <ul> elements. It's hard to imagine such common knowledge slipped past the WordPress developers' minds when they came up with the fantastic idea they should be altering people's code. They should have at least made sure they're altering the code to something valid.

  • Yeah...you're answer that I shouldn't use WordPress is great advice. Let's not ask any questions or bring up any faults for these kinds of things. We should just let the WordPress devs make mistakes. I'll do that in the future. Whenever I come across something off I'll just go use something else until I find that perfect program. – o_O Feb 5 '14 at 4:04
1

This should do the trick:

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
  • Thanks. I actually just moved all of my pages into their own templates to avoid having to ever look at the editor again anyway. It's much better for me this way anyway. – o_O Jan 29 '14 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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