I have next code:
if ( !is_admin()) {
function register_my_js() {
wp_enqueue_script('my-js', get_bloginfo( 'template_directory' ).'/js/bg.js',array('jquery'), '1.0', true);
}
add_action('init', 'register_my_js');
}
I used is_home and is_front_page conditions, but when i do this, my script doesn't include, without conditions script works but on all pages. And i need only on fron page, what should i do?