php - WordPress wp_enqueue_ scripts not working -
i have problem enqueing superfish script website. i've been hours around , have no idea what's causing problem. i'm using theme based on underscroes (this second time using it) , enqueue script in functions.php using the
wp_enqueue_script( 'kornelije-stankovic-superfish', get_template_directory_uri() . '/js/superfish.js', array('jquery'), '20140711', true );
i load website using chrome, check resources , script doesn't load. of course script in /js folder exact name superfish.js.
the funny thing is, tried loading on other website in exact same manner , works fine!
any idea causing issue?
the wp_enqueue_script()
should called inside wp_enqueue_scripts
callback, this:
/** * proper way enqueue scripts , styles */ function theme_name_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true ); } add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
code wordpress codex.
edit
i suggest put function call wp_enqueue_script( 'kor...
inside _s_scripts()
in functions.php
file (the function have _s
replaced theme name ).
Comments
Post a Comment