Как заменить jquery на js при работе с динамическими элементами?
let items = document.querySelectorAll('.items');
items = document.querySelectorAll('.items');
<!DOCTYPE html>
<head>
<?php wp_head(); ?>
</head>
<main></main>
<footer></footer>
<?php wp_footer(); ?>
</body>
</html>
add_action( 'wp_enqueue_scripts', 'theme_style' );
function theme_style() {
wp_enqueue_style( 'style', get_stylesheet_uri());
wp_enqueue_style( 'default', get_template_directory_uri() . '/assets/css/default.css');
wp_enqueue_style( 'layout', get_template_directory_uri() . '/assets/css/layout.css');
};
add_action( 'wp_enqueue_scripts', 'theme_scripts' );
function theme_scripts() {
wp_deregister_script( 'jquery' );
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js');
wp_enqueue_script('jquery');
wp_enqueue_script('flexslider', get_template_directory_uri() . '/assets/js/jquery.flexslider.js', ['jquery'], null, true );
wp_enqueue_script('doubletaptogo', get_template_directory_uri() . '/assets/js/doubletaptogo.js', ['jquery'], null, true );
wp_enqueue_script('init', get_template_directory_uri() . '/assets/js/init.js', ['jquery'], null, true );
wp_enqueue_script('modernizr', get_template_directory_uri() . '/assets/js/modernizr.js', ['jquery'], null, false, null);
}
<section class="top">
<div class="wrapper-full">
<h2 class="top-title section-title">
Today top places to visit
</h2>
<div class="top-cards" style="positon:relative">
<div class="top-card" >
<div class="top-card-pic">
<img src="img/top/top-1.jpg" alt="NAGOYA" class="top-card-thumb">
</div>
<div class="top-card-stats" style="positon:absolute; top: 0">
<h3 class="top-card-title">NAGOYA</h3>
<div class="top-card-likes">
<span class="top-card-likes-value">
221
</span>
</div>
<div class="top-card-comments">
<span class="top-card-comments-value">
50
</span>
</div>
</div>
</div>
</div>
</div>
</section>