dashicon gets stripped out of text and html widgets
-
Hello,
I am using the Dara theme.
I have tried to use the html for the mail-dashicon in the footer widget.
I have tried using both the html widget and the text widget.
With the html widget the mail-dashicon is saved the first time. But when I re-open the widget and save it a second time, the dashicon is stripped.
With the text widget the dashicon is stripped on the first save.
See here: https://cccgnewsletter.wordpress.com/
I cannot insert the html for the mail-dashicon next to the line: ‘Don’t be shy. Send us an email.’
I am not sure but perhaps there is a bug in the customizer ?
Many thanks for your work.
The blog I need help with is: (visible only to logged in users)
-
Hi there,
I just did a quick test and do see that with the Text Widget the Dashicon is indeed getting striped. However, when I switched to the HTML Widget the icon saved as expected.
For your site I would recommend converting your text widget to an HTML widget. This also has the advantage of validating your HTML helping to avoid mistakes.
-
Many thanks for your reply.
I have taken the site off-line for now.
Thanks so much for your reply.
What I found was the html widget will save the dashicon on the first save.
But the html widget strips the dashicon on the second save.
It’s possible the Dara theme is not set up for dashicons.
That might explain why the html widget strips a dashicon on the second save.
Hope this makes sense.
-
Hi there,
Dashicons are part of the Core WordPress software, and what theme you have active won’t have any effect on how it works. The only effect a theme would have is how the icon actually appears, in terms of size, colour, etc. But what theme you have active cannot cause code to be stripped out of a widget in the Customizer.
I activated Dara on a test site and used the exact code you’re currently using at the bottom of the post in a HTML widget instead, saved the widget multiple times, and nothing was stripped from the code.
But I also see you’ve uploaded the icon directly to your media library there, rather than using the dashicon itself. If I use the dashicon itself in a widget it’s still not getting stripped out with multiple saves.
The only thing that will cause HTML to be stripped out is if it was somehow incorrectly formed, thus making it invalid. Can you please walk me through the exact process you’re following that leads to the dashicon being stripped?
For reference, here is the code I used (sans your actual email address), that’s working fine for me:
<a href="mailto:...@..."><span class="dashicons dashicons-email"></span></a><span style="padding-left:10px;font-style:italic;">Send us an email. Don't be shy !</span> -
Hello,
Thanks for looking into this.
I’ve made the site private for now.
I take you at your word — my coding was “improperly formed.”
Many thanks
- The topic ‘dashicon gets stripped out of text and html widgets’ is closed to new replies.