jishasanal on "How to wp_enqueue_script in child theme's functions.php?"

ساخت وبلاگ

Hi all,

I was using hueman theme.and I have created a child theme by using childify me
plugin.I named it as childhueman.Childhueman folder already has functions.php and style.css file.
I have created a custom Jquery file named jquery.js in childhueman folder.
childhueman/functions.php contains the following code

function theme_js() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
wp_enqueue_script( 'theme_js', get_stylesheet_directory_uri() . '/custom_js/jquery.js', array( 'jquery' ), '1.0' );
}
add_action('wp_enqueue_scripts', 'theme_js');

When I load
http://www.easybuddy.com.au/awpcp/browse-categories/?
all images are comes and goes immedialty.

Anybody please help me?

http://www.wpbeginner.com/wp-tutorials/how-to-properly-add-javascripts-and-styles-in-wordpress/ take a peek at this. you may need to register the scripts before you enqueue them and add the action, it's been a while since i did it!

jishasanal
Member
Posted 3 minutes ago #

Hi jack randall,
I have register the scripts but I got the same result nothing change...

function theme_js() {
wp_register_script('custom_script',get_stylesheet_directory_uri() . '/custom_js/jquery.js',array('jquery'),'1.0' );
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); // enqueue the script
wp_enqueue_script('custom_script');

}
add_action('wp_enqueue_scripts', 'theme_js');

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 241 تاريخ : يکشنبه 16 خرداد 1395 ساعت: 19:25