Showing Different Code on Pages With Different Layouts
function add_js_one_col_wpse_107240() { if (is_page()) { $pobj = get_queried_object(); if(!empty(get_post_meta($pobj->ID,’one-col’,true)) { wp_enqueue_script(/* … */); } else { wp_enqueue_script(/* … a different script … */); } } } add_action(‘wp_enqueue_scripts’,’add_js_one_col_wpse_107240′); get_queried_object will get you the page information. It will be a WP_Post object on a “Page”. global $post should probably work too, but this is cleaner. Use … Read more