Add custom JavaScript to from a post


/ Published in: PHP
Save to your folder(s)

Another source: http://wpswitch.com/blog/wordpress/an-introduction-to-wordpress-custom-fields/


Copy this code and paste it in your HTML
  1. <? if( is_single() and
  2. $customjs = get_post_meta($post->ID, 'custom_js', true) )
  3. echo "<script src='".$customjs."' language='javascript'></script>";
  4. ?>

URL: http://wordpress.org/support/topic/add-custom-javascript-to-ltheadgt-from-a-post

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.