Enque Javascript in Footer?

The fifth parameter is $in_footer. You have left that out. Add that parameter, set it to true. wp_register_script( ‘jquery’, “http” . ($_SERVER[‘SERVER_PORT’] == 443 ? “s” : “”) . “://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js”, false, null, true ); But I echo the concern expressed by @Andrew in a comment. You can cause yourself trouble by deregistering/replacing the core libraries. … Read more

Overwrite wp_enqueue_script under certain condition

The first wp_enqueue_script() in your code should be wp_register_script(). The enqueue function does the job while the register function is getting ready to do the job. It is always better to rather create a new js file to keep things organised. As to calling them, you can do the following wp_register_script( ‘abc’, ‘path_to’ ); wp_register_script( … Read more

Create shortcode to echo javascript

First of all, it looks like you are trying to enqueue version 2.2.4 of jquery, under the condition that jquery has already been loaded. That doesn’t look good. Secondly, you can’t just echo a script in a shortcode. You must add it to another script using wp_add_inline_script. Like this: function wpse238227_custom_shortcode23() { wp_enqueue_script(‘script-typed’, ‘https://www.example.comwp-content/themes/mediso-v1-03/typed.js’, array(‘jquery’)); … Read more

How can I remove the WordPress-Version (?ver=5.x) from my plugin

Change the 4th parameter from false to null. wp_enqueue_script( ‘myID’, $url, array( ‘jquery’ ), null, true ); From the wp_enqueue_script() documentation: $ver (string|bool|null) (Optional) String specifying script version number, if it has one, which is added to the URL as a query string for cache busting purposes. If version is set to false, a version … Read more

why quotes shown in WordPress?

I am not sure about the extra quotes. The best way to include a java script file is with wp_enqueue_script() as indicated here in the codex. The safe and recommended method of adding JavaScript to a WordPress generated page and WordPress Theme or Plugin is by using wp_enqueue_script(). This function includes the script if it … Read more

How to enqueue jquery in admin and why is it not already there?

First, check for syntax errors. The syntax highlighting seems to indicate that you have syntax errors. Second, don’t wrap your add_action() calls inside conditionals; rather, wrap your callback function content inside the conditionals, e.g.: <?php function theme_upgrade_alernt() { if ( is_admin() && $pagenow == ‘theme-install.php’ && $_GET[‘tab’]==”upload”){ // CODE GOES HERE } else { // … Read more

Jquery function working in Dev Console but not otherwise [duplicate]

As toscho pointed out, use jQuery(document).ready(function($) { … }); instead of $( function() { … }); Edit: Main problem is WP rich text editor escaping your html <script> tags. See https://codex.wordpress.org/Using_Javascript at the bottom of the page for a plugin-based workaround to turn off formating for specific posts/pages, allowing you to insert code. Alternately, add … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)