How to reference different css (bootstrap) stylesheets for the header and body of a page?
How to reference different css (bootstrap) stylesheets for the header and body of a page?
How to reference different css (bootstrap) stylesheets for the header and body of a page?
bootstrap carousel in wordpress home page showing small images and not responsive
I forgot to add a default case to the switch…case statement of my add_script_attributes function in the functions.php file. Sorry that I did not see this before. From my functions.php: function add_script_attributes($tag, $handle) { switch($handle) { case “Popper”: return str_replace(“src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js””, “src=”https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js” integrity=’sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo’ crossorigin=’anonymous'”, $tag); case “Bootstrap”: return str_replace(“src=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js””, “src=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js” integrity=’sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI’ crossorigin=’anonymous'”, $tag); default: return $tag; … Read more
You’ve tagged your question correctly with wp_enqueue_script but it doesn’t appear in your code so you are probably missing the jQuery library and bootstrap by the looks of it. Try adding the following: add_action(‘wp_enqueue_scripts’, ‘wp_add_jquery’); function wp_add_jquery () { wp_register_script( ‘my_jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js’); // Add your other scripts here (bootstrap, etc.) }
For Googlers looking for a solution after hours of research spl_object_id is your solution. Read more here: https://www.php.net/manual/en/function.spl-object-id.php Example: <?php $id = spl_object_id($object); ?> <div id=”carousel<?php echo $id;?> class=”carousel”>
I will provide an answer, because it works, but I’ll be waiting for an answer that more straightfully answer my question (about a pluging, specifically). What I realized after posting this question is that the starter theme that uses Bootstrap I installed thinking it would force the editor to use Bootstrap classes do display the … Read more
If you want to hide elements based on breakpoints ( screen widths ) – you can use the display classes of BootStrap 4 – this might be different if you use an older version of BS. https://getbootstrap.com/docs/4.0/utilities/display/ A simple example of a class name to hide an element on desktop would be: <div class=”d-sm-none”>HIDDEN ON … Read more
Display WP Meta Details in Bootstrap Modal
There are 2 problems: Problem 1 Your AJAX endpoint looks for my_id: $id = $_POST[‘my_id’]; But your javascript sends id: id : my_id Importantly: id != my_id They do not match. There is no $_POST[‘my_id’], that’s why you get a PHP notice Problem 2 You’re using $_POST but the code does not make a POST … Read more
You could use the dynamic_sidebar_params filter to do your own substitution. Something like this: add_filter(‘dynamic_sidebar_params’, function($params){ $params[0][‘after_title’] = str_replace( ‘%1$s’, $params[0][‘widget_id’], $params[0][‘after_title’] ); return $params; });