I am developing a site that must be HTTPS secure and WordPress is loading <script src=".7.1.min.js"></script>
at the very top of my page, before <html>
and giving me an insecure error. I cannot find where this is being loaded from to prevent it from loading.
Unfortunately I cannot show the site as it's a federal credit union site and it would be against our contract agreement for me to present this site publicly before it is complete.
Here's a screenshot of the issue via Chrome web dev tools (click to zoom):
I am developing a site that must be HTTPS secure and WordPress is loading <script src="http://code.jquery/jquery-1.7.1.min.js"></script>
at the very top of my page, before <html>
and giving me an insecure error. I cannot find where this is being loaded from to prevent it from loading.
Unfortunately I cannot show the site as it's a federal credit union site and it would be against our contract agreement for me to present this site publicly before it is complete.
Here's a screenshot of the issue via Chrome web dev tools (click to zoom):
Share Improve this question edited May 6, 2015 at 6:35 user60546 asked Mar 20, 2013 at 21:02 Anthoney CarterAnthoney Carter 731 gold badge2 silver badges4 bronze badges 5 |
2 Answers
Reset to default 13When I build themes, I also like to make the WordPress header as clean as possible and then reconstruct it to my own liking. The code below is excessive for your question, but it might help you with other 'WordPress inserted code' in the future. The key snippet of code you are looking for is
wp_deregister_script('jquery');
wp_register_script('jquery', '', '', '', true);
Put this in your functions.php
file.
My whole WordPress header cleanup:
/* =Clean up the WordPress head
------------------------------------------------- */
// remove header links
add_action('init', 'tjnz_head_cleanup');
function tjnz_head_cleanup() {
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Category Feeds
remove_action( 'wp_head', 'feed_links', 2 ); // Post and Comment Feeds
remove_action( 'wp_head', 'rsd_link' ); // EditURI link
remove_action( 'wp_head', 'wlwmanifest_link' ); // Windows Live Writer
remove_action( 'wp_head', 'index_rel_link' ); // index link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // previous link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // Links for Adjacent Posts
remove_action( 'wp_head', 'wp_generator' ); // WP version
if (!is_admin()) {
wp_deregister_script('jquery'); // De-Register jQuery
wp_register_script('jquery', '', '', '', true); // Register as 'empty', because we manually insert our script in header.php
}
}
// remove WP version from RSS
add_filter('the_generator', 'tjnz_rss_version');
function tjnz_rss_version() { return ''; }
You can also download the library from jQuery and load it as a normal script in your functions.php file and end wp_enqueue_script
in a true
statement, this prints the script just before the </body>
.
wp_enqueue_script('customjquery', get_template_directory_uri(). '/js/jquery.min.js', array(), '2.1.4', true);
WordPress still uses jQuery 1.something I believe. I pull jQuery separate because I'm using the latest version of bootstrap and want the lastest version of jQuery. Just remember to add true to your statement
wp_enqueue_script
issue. – Anthoney Carter Commented Mar 20, 2013 at 21:15wp_enqueue_script
issue. WordPress loads it's own version of jQuery from the includes folder, so your theme is doing something somewhere. – Milo Commented Mar 20, 2013 at 21:20