How to change number field to text field using JS

The original code is using prevAll on the minus button, but the target input appears later in the DOM. PrevAll worked fine for the plus button though, since the targeted input comes before the plus button. The modified code below is tested and working: jQuery(document).ready(function ($) { // Containing selector var parentSelector = $(‘.quantity’); // … Read more

How do I call for two js files into a custom template?

In your theme’s functions.php: function my_theme_slug_enqueue_script(){ if(is_page_template(‘path/to/template/relative/to/theme/directory/root/template_file.php’)){ wp_enqueue_script( ‘some_unique_string_name’, ‘path/to/js/file/script.js’, array(), false, true ); } } add_action( ‘wp_enqueue_scripts’, ‘my_theme_slug_enqueue_script’ ); Change the values in my snippet to your requirements (and you need to call wp_enqueue_script() twice, once for each of your JS files). The third parameter allows you to tell WordPress what other scripts this … Read more

Open image gallery on link click

As I understand it, you want to show a div element containing the gallery when Show Gallery is pressed – otherwise to hidden. This can be accomplised with a couple of jQuery lines: $( “.show” ).click(function() { $( “.gallery” ).addClass( “display” ); }); With the appropriate CSS. See jsfiddle Be sure to remember to include … Read more