[Support request] HTML Widget adding extra and

Home Forums Support [Support request] HTML Widget adding extra and

Home Forums Support HTML Widget adding extra and

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #2333182
    BILAL

    Why HTML widget is adding extra <p> <br> between codes which I am adding through html widget?

    #2333259
    David
    Staff
    Customer Support

    Hi there,

    because the HTML Widget uses the autop function.
    See here to remove them:

    https://stackoverflow.com/a/69099574

    regarding the </br> don’t add unncessary line breaks in your HTML.

    #2333771
    BILAL

    why HTML widget is adding these </br> in the following script:

    <script><br />
    var vi_stickyConfig = {<br />
    ‘widthActive’: 1000,<br />
    ‘elementSidebar’: ‘.inside-right-sidebar’,<br />
    ‘distanceFixedTop’: -555,<br />
    ‘distanceFixedTop2’: 15,<br />
    ‘distanceFixedTop3’: 15,<br />
    ‘distanceFixedTop4’: 15,<br />
    ‘addingFixedTop’: 25,<br />
    ‘startFixed’: 750,<br />
    ‘endFixed’: 1500,<br />
    ‘distanceChangeTop’: 750,<br />
    ‘startFixed2’: 2550,<br />
    ‘endFixed2’: 3200,<br />
    ‘distanceChangeTop2’: 1350,<br />
    ‘sidebarStickyMode’: ‘sticky’,<br />
    ‘paddingSidebar’: true,<br />
    ‘distanceChangeTop3’: 2300,<br />
    ‘startFixed3’: 3800,<br />
    ‘endFixed3’: 4800,<br />
    ‘startFixed4’: 5650,<br />
    ‘endFixed4’: 6800,<br />
    ‘connectElement’: “#categories-4”,<br />
    ‘connectElementFixedTop’: 580,<br />
    ‘connectElement2’: “#recent-posts-3”,<br />
    ‘connectElementFixedTop2’: 580,<br />
    }<br />
    document.addEventListener(‘DOMContentLoaded’, (event) => {<br />
    var hMain = document.querySelector(“#main”).offsetHeight;<br />
    if (hMain < 6000) {
    vi_stickyConfig.sidebarStickyMode = “normal”;
    }
    var script = document.createElement(‘script’);
    script.type = ‘text/javascript’;
    script.async = true;
    script.src = “//static.vliplatform.com/plugins/smartsidebar/v2/visticky.max.js?v=0.53165”;
    document.head.appendChild(script);
    });
    </script>
    #2333774
    BILAL

    Also your suggested solution does not work for HTML widget:
    https://stackoverflow.com/a/69099574

    #2333816
    David
    Staff
    Customer Support

    Its probably related to this:

    https://github.com/WordPress/gutenberg/issues/33832

    Its not a theme issue.

    Why are you using a widget to add that script ? You can use a Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    and use the wp_footer hook.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.