I cannot figure out how to get this Bootstrap Switch extension to work with my WordPress installation.
When I download the example from github and run it on my local machine, the controls work perfectly. But they don't seem to be working in WordPress at all. In order to test it, I have a rewrite rule set up so that www.url.com/testing points to sandbox.php. In the same directory as sandbox.php (which is in my child theme's folder) I have placed the following files:
- bootstrapSwitch.css
- jquery.min.js
- bootstrapSwitch.js
This is the contents of sandbox.php:
<html>
<head>
</head>
<body style="padding-top: 50px;">
<link rel="stylesheet" href="bootstrapSwitch.css">
<script src="jquery.min.js"></script>
<script src="bootstrapSwitch.js"></script>
<div class="switch" data-on="primary" data-off="info">
<input type="checkbox" checked/>
</div>
</body>
</html>
And all that shows up is a single checkbox. When I open a .php file sitting in a folder on my desktop containing all of those same files, it works perfectly.
What is going on here?
<link rel="stylesheet" href="bootstrapSwitch.css">
should be in the<head>
of the document. Why dont youwp_enqueue_script
the JS andwp_enqueue_style
the css?