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

How would I add this code to a single WordPress page?

function bettingModuleFunction(){ // your content }; add_shortcode( ‘print_betting_module’, ‘bettingModuleFunction’ ); Put this in your functions.php and you can call the content using [print_betting_module] shortcode. If you need to call this shortcode inside a file use: echo do_shortcode(‘[print_betting_module]’); If you need to use your shortcode inside widgets put this in functions.php add_filter( ‘widget_text’, ‘do_shortcode’ );

Simple SCript Not Displayed in WIdth

You maybe need to enqueue the js file after jQuery or any other library. It also depends on how you want to implement this (with your theme or plugin), but it’s another question. You need to read more about wp_enqueue_scripts action to register and enqueue in the right way and see into Discord manual to … Read more

How to display archive by selecting year and then selecting month

Unfortunately there is no way to nest wp_get_archives to achieve this, so you will have to build your own loop using get_month_link Like this (untested, regard this as a starting point): $year = 2009; while ($year =< get_the_time(‘Y’)) { echo ‘<ul>’ $month = 1; while ($month =< 12) { $link = get_month_link ($year, $month); if … Read more

How to implement custom Javascript to my site

Consider using the Localize script in WordPress <?php // Register the script wp_register_script( ‘some_handle’, ‘path/to/myscript.js’ ); // Localize the script with new data $translation_array = array( ‘some_string’ => __( ‘Some string to translate’, ‘plugin-domain’ ), ‘a_value’ => ’10’ ); wp_localize_script( ‘some_handle’, ‘object_name’, $translation_array ); // Enqueued script with localized data. wp_enqueue_script( ‘some_handle’ ); You can … Read more