Created
May 15, 2013 22:14
-
-
Save yurivictor/5587862 to your computer and use it in GitHub Desktop.
header scripts
This file contains 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 | |
/** | |
* Hook actions in that run on every page-load | |
* | |
* @uses add_action() | |
*/ | |
private function add_actions() { | |
add_action( 'wp_enqueue_scripts', 'enqueue_scripts' ); | |
} | |
/** | |
* Enqueue the necessary CSS and JS | |
* | |
* @uses wp_enqueue_script | |
*/ | |
public function enqueue_scripts() { | |
// JS | |
// SET UP DEV VARIABLES | |
if ( ENVIRONMENT == 'DEV' ) { | |
$scripts_url = 'http://qaprev.digitalink.com/'; | |
} else { | |
$scripts_url = 'http://js.washingtonpost.com/'; | |
} | |
// SET UP ARTICLE ONLY SCRIPTS | |
if ( is_singular() ) { | |
wp_enqueue_script( 'tumblr', 'http://platform.tumblr.com/v1/share.js', null, '', false ); | |
wp_enqueue_script( 'floating-menus', get_template_directory_uri() . '/js/floating-menus.js', array( 'jquery' ), '4.3', false ); | |
wp_enqueue_script( 'twp_comments', $scripts_url . '1d/twp-comments.js', array( 'jquery' ), '3.6', true ); | |
wp_enqueue_script( 'quiz_script', $scripts_url . 'rw/sites/twpweb/js/module/module.quiz.js', array( 'jquery' ), '', true ); | |
} | |
// USE TROVE ON SPORTS ONLY | |
if ( 'sports' == get_option( 'blog_section' ) ) { | |
wp_enqueue_script( 'revplat_wp_config_2', 'http://s.troveread.com/moneta/2.x/js/revplat.wp-config.js', array( 'jquery' ), '', false ); | |
wp_enqueue_script( 'moneta_min', 'http://s.troveread.com/moneta/2.x/js/moneta.min.js', array( 'jquery' ), '', false ); | |
} else { | |
wp_enqueue_script( 'revplat_wp_config', 'http://bunsen.wapolabs.com/revplat/prod/1.4.5-5/js/revplat.wp-config.js', array( 'jquery' ), '', false); | |
wp_enqueue_script( 'revplat_min', 'http://bunsen.wapolabs.com/revplat/prod/1.4.5-5/js/revplat.min.js', array( 'jquery' ), '', false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment