0

I don't know why when I'm using "Enter", that add   in Pages/Posts Editor. That doesn't matter, but on my website, when I look the code   makes this code :

<p> � </p>

and � appears on my website...

How can I change that to simple code :

<p> </p>
0

It's &nbsp; with the trailing semicolon. Not without, maybe that's the problem?

edit: also the question is quite hard to understand. Do you add those &nbsp;s by hand or is the editor adding them even though you don't want them or what?

  • Yes, it's &nbsp; with semicolon, sorry. When I'm editing text and I just tap on ENTER without writing something, that makes <p> � </p>, and I would like that becomes <p> </p> but if I'm tapping something after skipping line, that's right : � doesn't appear – Vjardel Mar 26 '15 at 13:21
  • updated : I just need to change <p>�</p> to <p></p> – Vjardel Mar 26 '15 at 13:35
  • Well yeah but that's very strange. When I hit enter it doesn't add anything but a line break in editor, not any content. Does it still do this if you disable all plugins? – jimihenrik Mar 26 '15 at 14:01
0

Here is the code I needed :

<?php
/* Plugin Name: Erase "�" */
function replace_content($content)
{
$content = str_replace('�', '&nbsp;',$content);
return $content;
}
add_filter('the_content','replace_content')
?>

I put in plugins, and now that's ok !

Mhhh not really … 😟 I think it's a encoded problem.

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.