• 1.
    <?php
  • 2.
    if ( ! is_admin() ) { add_action( 'wp_enqueue_scripts', 'woothemes_add_javascript' ); }
  • 3.
     
  • 4.
    if ( ! function_exists( 'woothemes_add_javascript' ) ) {
  • 5.
    	function woothemes_add_javascript() {
  • 6.
    		global $woo_options;
  • 7.
     
  • 8.
    		$general_dependencies = array( 'jquery' );
  • 9.
    		if ( isset( $woo_options['woo_enable_lightbox'] ) && $woo_options['woo_enable_lightbox'] == 'true' ) { $general_dependencies[] = 'prettyPhoto'; }
  • 10.
    		
  • 11.
    		global $post;
  • 12.
    		$threesixty = get_post_meta($post->ID, '360', true);
  • 13.
    		if ($threesixty == '') {
  • 14.
    		wp_register_script( 'prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array( 'jquery' ) ); 
  • 15.
    		}
  • 16.
    		wp_register_script( 'portfolio', get_template_directory_uri() . '/includes/js/portfolio.js', array( 'jquery', 'prettyPhoto' ) );
  • 17.
    		wp_enqueue_script( 'third party', get_template_directory_uri() . '/includes/js/third-party.js', array( 'jquery' ) );
  • 18.
    		wp_enqueue_script( 'general', get_template_directory_uri() . '/includes/js/general.js', $general_dependencies );
  • 19.
    		// Load Flexslider for homepage
  • 20.
    		if ( is_home() || is_front_page() ) {
  • 21.
    			wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider-min.js', array( 'jquery' ) );
  • 22.
    		}
  • 23.
    		// Load Portfolio JS for homepage, page template, single page, post type archive, and taxonomy archive
  • 24.
    		if ( is_page_template( 'template-portfolio.php' ) || is_front_page() || ( is_singular() && get_post_type() == 'portfolio' ) || is_tax( 'portfolio-gallery' ) || is_post_type_archive( 'portfolio' ) ) {			
  • 25.
    			wp_enqueue_script( 'portfolio' );
  • 26.
    		}
  • 27.
    		// Load PrettyPhoto for homepage
  • 28.
    		if ( ( is_home() || is_front_page() ) &&  ( isset($woo_options['woo_portfolio_area']) && $woo_options['woo_portfolio_area'] == 'true' ) && ( isset($woo_options['woo_portfolio_linkto']) && $woo_options['woo_portfolio_linkto'] == 'lightbox' ) ) {
  • 29.
    			wp_enqueue_script( 'prettyPhoto' );
  • 30.
    		}
  • 31.
    	}
  • 32.
     
  • 33.
    	do_action( 'woothemes_add_javascript' );
  • 34.
     
  • 35.
    }
  • 36.
     
  • 37.
    if ( ! is_admin() ) { add_action( 'wp_print_styles', 'woothemes_add_css' ); }
  • 38.
     
  • 39.
    if ( ! function_exists( 'woothemes_add_css' ) ) {
  • 40.
    	function woothemes_add_css () {
  • 41.
    		
  • 42.
    		wp_register_style( 'prettyPhoto', get_template_directory_uri().'/includes/css/prettyPhoto.css' );
  • 43.
    	
  • 44.
    		if ( is_page_template('template-portfolio.php') || is_front_page() || ( is_singular() && get_post_type() == 'portfolio' ) || is_tax( 'portfolio-gallery' ) || is_post_type_archive( 'portfolio' ) ) {
  • 45.
    			wp_enqueue_style( 'prettyPhoto' );
  • 46.
    		}
  • 47.
    	
  • 48.
    		do_action( 'woothemes_add_css' );
  • 49.
    	
  • 50.
    	} // End woothemes_add_css()
  • 51.
    }
  • 52.
     
  • 53.
    // Add HTML5 shim in <IE9
  • 54.
    add_action( 'wp_head', 'woo_html5' );
  • 55.
    function woo_html5() {
  • 56.
    	global $is_IE;
  • 57.
    	if( $is_IE ) {
  • 58.
    		$browser = $_SERVER['HTTP_USER_AGENT'];
  • 59.
    		$browser = substr( "$browser", 25, 8 );
  • 60.
    		if ($browser == "MSIE 7.0" || $browser == "MSIE 6.0" || $browser == "MSIE 8.0" ) {
  • 61.
    			echo '<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>'; 	
  • 62.
    		}
  • 63.
    	}
  • 64.
    } // End woo_html5()
  • 65.
    ?>
<?php if ( ! is_admin() ) { add_action( 'wp_enqueue_scripts', 'woothemes_add_javascript' ); } if ( ! function_exists( 'woothemes_add_javascript' ) ) { function woothemes_add_javascript() { global $woo_options; $general_dependencies = array( 'jquery' ); if ( isset( $woo_options['woo_enable_lightbox'] ) && $woo_options['woo_enable_lightbox'] == 'true' ) { $general_dependencies[] = 'prettyPhoto'; } global $post; $threesixty = get_post_meta($post->ID, '360', true); if ($threesixty == '') { wp_register_script( 'prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array( 'jquery' ) ); } wp_register_script( 'portfolio', get_template_directory_uri() . '/includes/js/portfolio.js', array( 'jquery', 'prettyPhoto' ) ); wp_enqueue_script( 'third party', get_template_directory_uri() . '/includes/js/third-party.js', array( 'jquery' ) ); wp_enqueue_script( 'general', get_template_directory_uri() . '/includes/js/general.js', $general_dependencies ); // Load Flexslider for homepage if ( is_home() || is_front_page() ) { wp_enqueue_script( 'flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider-min.js', array( 'jquery' ) ); } // Load Portfolio JS for homepage, page template, single page, post type archive, and taxonomy archive if ( is_page_template( 'template-portfolio.php' ) || is_front_page() || ( is_singular() && get_post_type() == 'portfolio' ) || is_tax( 'portfolio-gallery' ) || is_post_type_archive( 'portfolio' ) ) { wp_enqueue_script( 'portfolio' ); } // Load PrettyPhoto for homepage if ( ( is_home() || is_front_page() ) && ( isset($woo_options['woo_portfolio_area']) && $woo_options['woo_portfolio_area'] == 'true' ) && ( isset($woo_options['woo_portfolio_linkto']) && $woo_options['woo_portfolio_linkto'] == 'lightbox' ) ) { wp_enqueue_script( 'prettyPhoto' ); } } do_action( 'woothemes_add_javascript' ); } if ( ! is_admin() ) { add_action( 'wp_print_styles', 'woothemes_add_css' ); } if ( ! function_exists( 'woothemes_add_css' ) ) { function woothemes_add_css () { wp_register_style( 'prettyPhoto', get_template_directory_uri().'/includes/css/prettyPhoto.css' ); if ( is_page_template('template-portfolio.php') || is_front_page() || ( is_singular() && get_post_type() == 'portfolio' ) || is_tax( 'portfolio-gallery' ) || is_post_type_archive( 'portfolio' ) ) { wp_enqueue_style( 'prettyPhoto' ); } do_action( 'woothemes_add_css' ); } // End woothemes_add_css() } // Add HTML5 shim in <IE9 add_action( 'wp_head', 'woo_html5' ); function woo_html5() { global $is_IE; if( $is_IE ) { $browser = $_SERVER['HTTP_USER_AGENT']; $browser = substr( "$browser", 25, 8 ); if ($browser == "MSIE 7.0" || $browser == "MSIE 6.0" || $browser == "MSIE 8.0" ) { echo '<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>'; } } } // End woo_html5() ?>

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter