Automatic WordPress Clone Backup

You should maybe consider if you are approaching the exercise the “wrong way around” 🙂 Kudos to you for thinking about backups, but I urge you to consider that if you had the site under version control, you could track every change that was made, have it automatically deployed to a staging server, and manually … Read more

Script not loading when depending on jQuery

You could run a couple checks and enqueue jquery if it’s not registered or enqueued using wp_script_is function bootstrap_script_init() { // Check to see if jQuery is registered, if not, register it. // You can use the local version of WP’s jQuery if you want instead of Google’s API. if ( !wp_script_is( ‘jquery’, ‘registered’ ) … Read more

Javascript asset not enqueuing with the rest

Your second wp_enqueue_script() contains the same handle (the same ID) as the first wp_enqueue_script(). The handle is the ID by which a registered script is known to WordPress internally. If you use this ID a second time, the second script won’t be registered. A working example could be this one: <?php add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles_and_scripts’ ); … Read more

Using jquery with wordpress using wp_enqueue_scripts

It sounds like your template is missing a call to wp_head() which will output your enqueued scripts and styles. You’d normally place wp_head() in your header.php template and include this in your page template. To conditionally enqueue jQuery based on the page template being used you could use the following code: add_action( ‘wp_enqueue_scripts’, ‘custom_theme_load_scripts’ ); … Read more