Cannot add div with data attributes and a script to wordpress custom html widget

  • Unknown's avatar

    I’m trying to add an HTML snippet to a WordPress hosted site and that snippet requires data attributes against the div. What I’ve found is that when using the “Custom HTML” component type in the post it strips the data attributes when the post is saved. What is annoying is if I preview the post it renders it correctly.

    <div
    data-calendar-key=”…”
    data-calendar-widescreen-months=”1″
    data-calendar-property-id=”575746″
    data-calendar-departure-picker=”true”
    data-calendar-show-translation=”true”>
    Your widget will appear here.
    </div>
    https://secure.supercontrol.co.uk/components/embed.js

    I’m trying to do this without needing to pay for a higher tier of WordPress that supports plugins and also because it is hosted by WordPress I don’t have access to fix the issue myself.

    Can anyone help with this issue at all?

    Thanks

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    You can’t embed script an other code in a wordpress.com site unless you upgrade to the Business Plan.

  • Hi there,

    You can find information on the code restrictions we have on WordPress.com here:

    Add Code to Your Site

  • The topic ‘Cannot add div with data attributes and a script to wordpress custom html widget’ is closed to new replies.