Created
June 19, 2014 10:17
-
-
Save amitabhaghosh197/8ea768411da4e0af5e85 to your computer and use it in GitHub Desktop.
cdn-function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cdn_urls = @fopen('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css', r); | |
$cdn_urls = @fopen('https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css', r); | |
if( $cdn_urls !== false) | |
{ | |
//USE CDNS | |
function stepup_cdn_css() | |
{ | |
wp_enqueue_style('bootstrap_css' , 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.min.css', false); | |
wp_enqueue_style('bootstrap_responsive_css' , 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap-responsive.min.css', false); | |
} | |
add_action('wp_enqueue_scripts', 'stepup_cdn_css'); | |
} //end of if | |
else | |
{ | |
//USE internal | |
function stepup_local_css() | |
{ | |
wp_enqueue_style ('bootstrap_css', TEMPLATE_DIRECTORY . 'css/bootstrap/bootstrap.css', false ); | |
wp_enqueue_style ('bootstrap_responsive_css', TEMPLATE_DIRECTORY . 'css/bootstrap/bootstrap-responsive.css', false ); | |
} | |
add_action('wp_enqueue_scripts', 'stepup_local_css'); | |
}// end of else | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment