amitabhaghosh197
6/19/2014 - 10:17 AM

cdn-function

cdn-function

<?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






?>