New answers tagged

0

The best way as far as i found, I followed this link . Just add the origin code to the wordpress header.php or ajax functions/api file. Link: [https://stackoverflow.com/a/25719261/5431206] Thanks


1

I had the same problem, a weird attribute wfd-id="" on every element. For me it was kaspersky password manager chrome extension, after deactivate it, everything backs to normal again, the weird attribute as gone. Hope it helps someone.


2

PHP is running on the server, JavaScript in the client. This means PHP is faster (more resources), the result can be cached, and you have to test only one interpreter. JavaScript – you don't really need jQuery for this – is more error prone, because of weird clients, blocked resources, or a more limited available memory. However it can respond to user ...


0

As different JS Frameworks use the $ for it's functions (jQuery, MooTools), Wordpress loads jQuery in the "noConflict"-Mode, which means that it doesn't use the $ but only jQuery. You can now use jQuery instead of $ encapsule your calls like RiddleMeThis proposed On a personal note: honestly, it's not that big a deal to replace the $ with jQuery, isn't it?...


0

WP uses noConflict(). If you want to use $ instead of jQuery you have a couple options. Option #1 - use a self-invoking function: (function($) { $(document).ready(function(){ ... }); }(jQuery)); Option #2 - Set noConflict(): Add var $ = jQuery.noConflict(); at the top of your custom JS file.


0

For anyone getting this problem in an admin page, use the admin_enqueue_scripts hook instead of the wp_enqueue_scripts hook. Documentation here.


1

Thanks for your help Sally, here is the completed jQuery which pushes the RGB value to another field. Name of the RGB field has _rgb at the end. jQuery(function() { var myOptions = { // you can declare a default color here, // or in the data-default-color attribute on the input defaultColor: false, // a callback to fire ...


0

To reset quantity input field to 1 when variation changes on product detail page use below code. you can set default quantity from jQuery("[name='quantity']").val(1);. i have tested and it is working fine for me. add_action( 'wp_footer', 'variation_change_update_qty' ); function variation_change_update_qty() { if (is_product()) { ?> ...


Top 50 recent answers are included