I wan to add a responsive div to my wordpress page using bootstrap css, just when i enqueued bootstrap style it distroy themes, so i wan to make that div load using ajax call, call that enqueued style after document is ready then i will add css classes using jquery addClass( ). This way themes styles will not be afected with my custom css
I wan to add a responsive div to my wordpress page using bootstrap css, just when i enqueued bootstrap style it distroy themes, so i wan to make that div load using ajax call, call that enqueued style after document is ready then i will add css classes using jquery addClass( ). This way themes styles will not be afected with my custom css
Styles won't be affected if you use different selectors. Create a custom stylesheet, and enqueue it immediatelly. When the page is ready just apply the styles to the mentioned responsive div, or create some logic behind it.
So for example if you have
<div class="custom-sidebar">Some content</div>
Enqueue custom style within functions.php
wp_enqueue_style( 'some-custom-styles', get_stylesheet_uri() . "/custom.css" );
Afterwards just assign whichever class you want
$( ".custom-sidebar" ).addClass( ".myClassFromCustomCSS" );
You may be able to use a shadow DOM (see https://css-tricks/playing-shadow-dom/), or put it an <iframe>
.
(will expand soon but don't have time right now.)