Javascript button to call custom fields data

Is this something you wish to achieve? <!DOCTYPE html> <html> <body> <h1>My First JavaScript</h1> <button type=”button” onclick=”var the_id=document.getElementById(‘my_field’).value; document.getElementById(‘demo’).innerHTML= document.getElementById(the_id).innerHTML;”> Click me to display some other string.</button> <p id=”demo”></p> <input id=”my_field” type=”text”></a> <div id=”someother”>Hi there!</div> </body> </html>

Add Javascript/Html into a WordPress

This plugin allows custom JS and custom CSS on a per post/page basis. https://wordpress.org/plugins/art-direction/ If you find that it is not compatible with your WP install, look for other plugins that allow custom JS and CSS. If you’re looking for a more robust solution, you can do something like the following: /* overlay-contact-form.css */ #overlayContactForm … Read more

Live Time on WP showing weirdly [closed]

Here’s an updated version of the code which fixes the extra zero caused by the redundant time checks in startTime(): JavaScript function startTime() { var d=new Date(); var h=d.getHours(); var m=d.getMinutes(); var s=d.getSeconds(); h = h % 12; h = h ? h : 12; // the hour ‘0’ should be ’12’ var ampm = … Read more

Why the images on mi javascript are not found?

You are missing /wp-content/themes/YOUR_theme_NAME_FOLDER like this: function sliderimgchange(){ if ($(window).width() <= 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone-mobile.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo-mobile.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree-mobile.jpg’); } else if ($(window).width() > 600) { var sliderOne = $(‘.slideuno’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderone.jpg’), sliderTwo = $(‘.slidedos’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/slidertwo.jpg’), sliderThree = $(‘.slidetres’).attr(‘src’, ‘/wp-content/themes/YOUR_theme_NAME_FOLDER/images/sliderthree.jpg’); } }

Making the HTML list to a checkbox tree with the plugin jstree [closed]

This worked for me. Basically jquery was missing through <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> and the wrong PHP tags. Thanks for that. You can find the full code below. <title> Hi all</title> <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/295053/<?php echo get_stylesheet_directory_uri().”/js/jstree/dist/themes/default/style.min.css’;?>” /> <div id=”data”> <ul> <li>One</li> <li>Two</li> <li>Three <ul> <li>Bike</li> <li>Ride</li> </ul> </li> <li>JOKE</li> </ul> </div> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.1/jquery.min.js”> </script> <script src=”<?php … Read more

Mobile menu will only toggle on

Please read this documentation https://developer.wordpress.org/reference/functions/wp_nav_menu/ menu_id (string) The ID that is applied to the ul element which forms the menu. The default is the menu slug, incremented. container_id (string) The ID that is applied to the container. Try to add container_id in wp_nav_menu array(), I hope it’ll help you out. Thanks wp_nav_menu(array( ‘theme_location’ => ‘header-menu’, … Read more

Include Facebook Javascript SDK In WordPress

I’m assuming you’re referring to the header.php file of your theme. In that case, it’s as easy as just enqueueing the script by appending this function to your theme’s functions.php file: function enqueue_facebook_javascript_sdk(): void { wp_enqueue_script( ‘facebook-javascript-sdk-initializer’, get_template_directory_uri() . ‘/path/to/your/initializer.js’ ); wp_enqueue_script( ‘facebook-javascript-sdk’, ‘https://connect.facebook.net/en_US/sdk.js’, array(), null ); return; } add_action( ‘wp_enqueue_scripts’, ‘enqueue_facebook_javascript_sdk’ ); The first … Read more

Embed Kajabi into WP

Welcome to WPSE. When asking a question it is recommended to include your research and what you’ve already tried in your question. One option would be to turn the script into a shortcode with add_shortcode(). With a custom shortcode you can have any Kajabi form anywhere on your site as long as the shortcode takes … Read more