• Im having some issue with my text widget.
    everytime I post a code for example –

    <img src="<?php echo of_get_option('main_image') ?>" width="100%" /> ,

    the text widget automatically changes the code to this-

    <img src="\" width=\"100%\" />

    Anyone have an idea on how to fix this? Its not only the code above but every html code I post it change the open and closing tags.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The default text widget is not configured to handle any PHP code (for good user experience and security reasons likely).

    But you are saying that any HTML code you paste in the text widget area is getting these extra back slashes?

    You don’t have anything in your theme’s functions.php file that is filtering the widget content?

    Have you disabled all plugins and used a default WordPress theme and tried the text widget to see if it happens then?

    Thread Starter apaolo

    (@apaolo)

    @bemdesign – not only the back slashes – something like this

    &lt ; img src=&quot ;” width=”100%” / &gt ;

    wordpress is automatically replace the <>, ” into &lt ; &gt ; and &quot ;

    I alreadu enhance the text widget using a plugin before so it work fine before not until lately when wordpress updated to 4.3.1.

    Thread Starter apaolo

    (@apaolo)

    Yup I tried to disable all the plugin but its still the same.

    Have you tried a default WordPress theme? Some themes have functionality baked in (through the template pages or even through the functions.php file). Try a default theme and with all plugins turned off and see what happens. It sounds like something is converting the HTML code into HTML character entities.

    Thread Starter apaolo

    (@apaolo)

    OK, switch my theme to Twenty Fifteen and Turned off all plugins but nothing happend. the code still automatically changeI guess this is wordpress issue because it only happened when I updated my version to 4.3.1

    Hmmm… I’m going to test things on one of my dev sites and see if I can recreate the issue.

    Results from testing on a default WordPress install running TwentyFifteen theme, using the text widget:

    All HTML code outputs normally – I can not recreate your issue.

    So at this point, I’d suggest doing a manual update of WordPress core files. Perhaps the previous update didn’t complete correctly.

    Thread Starter apaolo

    (@apaolo)

    Ok Thanks bemdesign

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Having some issue in text widget’ is closed to new replies.