• Hi, I have a problem with running some javascript, and as far as I can tell, all my code is completely okay. Here’s the code in my functions.php file:

    <?php
    function ColTheme_enqueue_scripts(){
    echo "Testing";
    wp_enqueue_script('scrippyj', get_bloginfo('template_directory') . '/scrippyj.js');
    }
    add_action('init', 'ColTheme_enqueue_scripts');
    ?>

    The “Testing” text prints successfully on my site, but the scrippyj.js file does not run. I’ve tried using get_template_directory_uri() instead of get_bloginfo, but that didn’t change anything. I even looked at the website’s source code, and there is nothing mentioned about enqueueing scripts.

    Also, possibly related, now when I try to go to my WordPress dashboard, I get an error:
    “Warning: Cannot modify header information – headers already sent by (output started at /home4/cbrummette/public_html/wp-content/themes/ColTheme/functions.php:2) in /home4/cbrummette/public_html/wp-includes/pluggable.php on line 1167”

    Does someone know what’s going on? Thanks in advance

Viewing 4 replies - 16 through 19 (of 19 total)
Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘wp_enqueue_script not working, no idea why’ is closed to new replies.