- This topic has 4 replies, 2 voices, and was last updated 6 months, 3 weeks ago by
David.
-
AuthorPosts
-
September 4, 2022 at 8:31 am #2333182
BILAL
Why HTML widget is adding extra <p> <br> between codes which I am adding through html widget?
September 4, 2022 at 11:56 am #2333259David
StaffCustomer SupportHi 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 5, 2022 at 5:35 am #2333771BILAL
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>September 5, 2022 at 5:42 am #2333774BILAL
Also your suggested solution does not work for HTML widget:
https://stackoverflow.com/a/69099574September 5, 2022 at 6:46 am #2333816David
StaffCustomer SupportIts 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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.