Skip to content

Instantly share code, notes, and snippets.

@scottnix
Last active December 20, 2015 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottnix/6201993 to your computer and use it in GitHub Desktop.
Save scottnix/6201993 to your computer and use it in GitHub Desktop.
Adding a script to Wordpress, with page conditional
<?php
// add script to WP with a page conditional
// thematictheme.com/forums/topic/adding-javascript-to-style-an-element/
function childtheme_add_shit_to_head() {
if ( is_page( 80 ) ) { ?>
<script>Script....</script>
<?php }
}
add_filter('wp_head', 'childtheme_add_shit_to_head');
@marybaum
Copy link

marybaum commented Jan 3, 2014

ROTFL! </easily_amused>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment