• I wrote a plugin that injects a stylesheet and a couple scripts into wp_head:

    function add_support_code() {
    	wp_enqueue_style("ramp_css", ".../ramp-styles.css");
    	wp_enqueue_script("jquery_ui", ".../jquery-ui.min.js");
    	wp_enqueue_script("ramp_js", ".../ramp-scripts.js");
    }
    
    add_action('wp_head', 'add_support_code');

    I had this break on a specific blog, and I found out it was because I didn’t have wp_footer() in the theme. Adding that fixed things. I looked at my other blogs’ HTML output and the code output also shows up in the footer.

    This isn’t really a bug at this point, but I thought I’d learn more about wp_head, wp_footer, and why my add_action would insert this code in the wrong one.

  • The topic ‘add_action for wp_head, executing in wp_footer’ is closed to new replies.