• Woah! I’ve been reading the Codex, forums and done the usual searches but I’m stumped.

    How do you include a JS file based on the contents of a post_meta?
    Here’s what I’ve tried to do:

    add_action('init', 'post_meta_conditional');
    function post_meta_conditional(){
        if get_post_meta... =  the post I'm looking for
        wp_register_script...
        wp_enqueue_script...
    }

    But the JS doesn’t get included. I’ve tried multiple hooks – nada.

    Any thoughts and in advance, I really appreciate it.
    Thanks
    Charlie

  • The topic ‘Conditional Javascript and all that Jazz’ is closed to new replies.