Trying to Load jQuery

When enqueuing a script from a child theme, you have to use get_stylesheet_directory_uri rather than get_template_directory_uri(). The template directory is the parent theme, and the stylesheet directory is the one shared by the directory the active stylesheet is using. In your functions.php file, the enqueuing would be: function avtheme_scripts() { wp_enqueue_script( ‘av-about-fade’, get_stylesheet_directory_uri() . ‘/js/about-fade.js’, … Read more

How to display comments length

I used this: function wpb_countx() { wp_enqueue_script(‘jquery’); ?> <script> jQuery(function($) { // configure var comment_input = $( ‘#commentform textarea’ ); var submit_button = $( ‘#commentform .form-submit’ ); var comment_limit_chars = 1400; // stop editing here // display how many characters are left $( ‘<div class=”comment_limit_info”><span>’ + comment_limit_chars + ‘</span> zbývá znaků</div>’ ).insertAfter( comment_input ); comment_input.bind( … Read more

How to make jquery count down timer function manually editable

You can achieve this using wp_footer action. Add bellow code to functions.php file. It will load the script at the footer of page. add_action(‘wp_footer’, ‘load_count_down’); function load_count_down(){ if ($year = get_option(‘of_year’) && $month = get_option(‘of_month’) && $day = get_option(‘of_day’) ) { $date = $year.”https://wordpress.stackexchange.com/”.$month.”https://wordpress.stackexchange.com/”.$day; $script = <<<EOF <script type=”text/javascript”> var siteCountDown = function() { if … Read more

How can i unload effect.min.js file?

If you want to remove Effect Core the you have to remove depended scripts too. Follow this to remove them: add_action( ‘wp_enqueue_scripts’, ‘remove_jquery_effects’, 100 ); function remove_jquery_effects() { wp_dequeue_script( ‘jquery-effects-core’ ); wp_dequeue_script( ‘jquery-effects-blind’ ); wp_dequeue_script( ‘jquery-effects-bounce’ ); wp_dequeue_script( ‘jquery-effects-clip’ ); wp_dequeue_script( ‘jquery-effects-drop’ ); wp_dequeue_script( ‘jquery-effects-explode’ ); wp_dequeue_script( ‘jquery-effects-fade’ ); wp_dequeue_script( ‘jquery-effects-fold’ ); wp_dequeue_script( ‘jquery-effects-highlight’ ); … Read more

datepicker for custom post type admin

Issues I noticed in your code I don’t see where/how you’re calling that custom datepicker() function and you should use the same admin_enqueue_scripts hook for registering/enqueueing a stylesheet (.css) file. You should only load the CSS and JS files on the pages where the styles and scripts are being used, e.g. in your case, the … Read more

Load more posts in the same category – Ajax + Timber

I think there is a small correction in your code, you just passing page number but you have pass category ID also. I’ve added data-category attribute in load more button. So your archive.twig should like: <section class=”archive”> <p class=”archive__title h-headline text-size-l”>In the same thematic</p> <div id=”archive__list” class=”archive__list”> <article class=”post”> … </article> </div> </section> {% if … Read more

problem with jquery 3.5.1 in footer

GREAT… thank you very much. It opens my mind. I’ve tried to translate this eventListener in bind jQuery version, but I can’t. So I modified the FancyBox Jquery to read directly wp block < a href > $(“li.blocks-gallery-item figure a”).fancybox({ /* wp block version */ }); $(‘.fancybox’).fancybox({ /* fancybox default standard */ });