M
M
Mikhail Lebedev2021-10-10 17:08:38
JavaScript
Mikhail Lebedev, 2021-10-10 17:08:38

Connecting jquery wordpress regularly?

Why does jQuery not work with this option?

add_action( 'wp_enqueue_scripts', 'dipped_enqueue_styles' );
function dipped_enqueue_styles() {
    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'my_js', get_stylesheet_directory_uri() . '/script.js', array( 'jquery' ), time(), null, true, );
}


when I connect jquery I copy it to / script.js everything works,

what am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question