• Resolved john_aku

    (@john_aku)


    I have the following code in my plugin. The problem is that it does not enqeue jquery and the scripts. This is the code

    add_action('wp_enqueue_scripts', 'my_scripts');
    function my_scripts() {
    	global $post;
    
    	wp_enqueue_script('jquery');
    
    	//register and enque scripts
    	wp_register_script('myjs_script', plugins_url('js/myscript.js', __FILE__), array('jquery'));
    	wp_enqueue_script('myjs_script');
    
    	//register and enque styles
        wp_register_style('myjs_script_styles', plugins_url('css/my.css', __FILE__));
    
        wp_enqueue_style('myjs_script_styles');
    
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘enqeue_script not working in plugin’ is closed to new replies.