adsense

How to Get WordPress to Use Google CDN





1. Go to your website's 'wp-admin' directory and log in to the WordPress dashboard. Click 'Appearance' in the menu on the left-hand side of the screen and then click the 'Editor' link that appears.
2. Locate your 'functions.php' file in the list under 'Templates' on the right-hand side of the 'Edit Themes' screen. Click the link to open the file. Scroll down to the bottom and add this code:function register_google_cdn_jquery() {wp_deregister_script('jquery');wp_register_script('jquery', ' http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js');wp_enqueue_script('jquery');}Make sure this code goes above the ending '?>' PHP delimiter. You can change 'register_google_cdn_jquery' to another function name if you like. The above example shows how to deregister the copy of jQuery that comes with WordPress and register the Google CDN version, but you can do this for other scripts hosted by Google.

3. Add this code after your function that registered the Google CDN script:add_action('init', 'register_google_cdn_jquery');You must match the second parameter to the name of the function you used to register the Google CDN script. The first parameter, 'init,' is the initializer for WordPress. In simple terms, the next time you run WordPress, the 'register_google_cdn_jquery' function will run.
4. Click the blue 'Update File' button to save your work.

Comments

1 Response to "How to Get WordPress to Use Google CDN"

Unknown said... September 18, 2013 at 2:56 AM

Thanks for this advice , can We also Add Google Ad sense by the way Belterra Casino Resort

Post a Comment

Popular Posts

About