Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is included with WordPress, and available to both themes and plugin developers.

0
votes
1answer
15 views

How to call a function from functions.php with ajax?

I'm wondering how can i call a function from functions.php and print it with Ajax in a specific place (woocommerce_before_add_to_cart_button). I know i can simply add my function in add_action like ...
0
votes
0answers
17 views

Wordpress Plugins not working - Jquery showing errors

I'm new to the development world and I started by migrating an Html web site to Wordpress theme using a backbone theme. Everything looks good on the website (on localhost & live) but not on my ...
0
votes
1answer
18 views

Smooth scrolling jQuery not working

I am having trouble getting smooth scrolling to my anchor links. I think i'm struggling to get jQuery working with WordPress. In the functions.php file, I have inserted the following code near the ...
0
votes
0answers
22 views

Load plugin after the page has been fully loaded [on hold]

Currently, my page take 1-2 seconds to load. Until it loads, it shows a loading gif. I recently installed a JQuery plugin (WP full calendar) which displays a calendar with events and also shows a ...
0
votes
0answers
13 views

jQuery show the total of (ACF custom number field * quantity) in singel product page [closed]

Hello programmers please help me I am a beginner with wordpress and really have a llot of time trying to fix this .. I am using: WordPress 4.9.8 Woocommerce 3.4.5 divi premium theme ACF plugin pro ...
0
votes
1answer
26 views

Using JS and WP custom field to set Input Step Increment - not working [on hold]

I have a custom field in the WP admin for the site manager to select a quantity step of products sold at once. So if would like products sold in pairs, or 3's etc. I have some code borrowed from the ...
0
votes
0answers
9 views

How check event jquery wp.media image selected before when click change image post?

I used to function : var selection = wp.media.frame.state().get( "selection" ); selection.on( "selection:single", function () { }); But i only work when i chang select image. It conslo.log ...
0
votes
0answers
27 views

jQuery not working what could be the problem the CDNs are all ok [closed]

Hey guys could you please assist me in understanding why jQuery is not loading in this case. I think I have all the files correct. Thanks the site Im working on is peakessaywriters.com <meta http-...
0
votes
0answers
16 views

Uncaught TypeError: jQuery(…).flipster is not a function in wordpress

I have used jquery flister plugin in WordPress child theme. But getting Uncaught TypeError: jQuery(...).flipster is not a function. I have added flister js and css file in function.php Like: ...
0
votes
1answer
25 views

jquery plugin won't fire when hamburger class element clicked

I have a company WordPress website developed by a vendor where customers making online payments get navigated to a third-party website to manage that. Initially, we had direct urls built into the ...
-1
votes
0answers
8 views

Shipping Options on checkout not working on Safari

I have 4-5 Shipping option on my woocommerce shop all is working fine but on safari just the shipping options are changing whenever i changed the option to other one it still keep active the current ...
0
votes
0answers
19 views

Multiple recaptcha validation

There are multiple recaptcha on single page. How to check if a particular one is checked on a form submit of a particular form?
0
votes
0answers
25 views

Displaying dynamic pages inside another page in wordpress

I have a webpage that is built using visual bakery (shortcodes) in wordpress, now i want to display that page inside my account/downloads page such that if a condition is met then display page ...
0
votes
0answers
20 views

jquery get wordpress php

Im not precisely sure, what to write at jQuery('.switch_to_prev').click[...] and jQuery('.switch_to_next').click[...], so I will get an AJAX of my posts. (My head tells me this, "On click, look for ...
0
votes
0answers
11 views

jquery in wordpress, two event handlers in a element

I try to make smooth scroll to anchor @ my wordpress web. I found the plug-in, 'jquery smooth scroll' and installed it to my wordpress web. It works well in desktop PC web browser but it does not ...
-3
votes
1answer
17 views

Count div with class (.length) only shows 0 [closed]

I want to count a div with a class (it's a class from the Plugin Revolution Slider) div.tp-tab This class exists 3 times! I have tried this: <script type="text/javascript"> jQuery(document)....
1
vote
0answers
30 views

jquery.validation.js is not working in woocommerce checkout page form

jQuery("#woocommerce_checkout_form").validate({ highlight: function(element) { (jQuery(element).parent()).parent().addClass("woocommerce-invalid"); (jQuery(element)....
1
vote
0answers
7 views

How to toggle between two div elements using a button [migrated]

I know how to toggle div, that is to hide/show elements. But how to toggle between two div's ? <button>Change</button> <div class="english"> <h4><strong>English ...
0
votes
1answer
22 views

Not displaying Woocommerce product page in lightbox

I have installed a plugin named "WP Post Popup" . It is easy to use and allows any link to show in a lightbox. I have entered the below code $wproduct = get_post( $wproduct_id ); $wslug = $...
2
votes
1answer
27 views

Working Bootstrap Carousel Conversion to WP - Technical Questions

I have coded a working Bootstrap carousel, it needs to be converted to WP. It's a small chunk of the site, but as a Wordpress newbie, am stuck in understanding the technical issue. So here's what I ...
0
votes
0answers
32 views

Custom theme admin-ajax.php 400 (Bad Request)

I am trying to load posts via ajax in WordPress but I am getting admin-ajax.php 400 (Bad Request) error. I have used the same code in one other website and it was working there but here in this ...
0
votes
0answers
15 views

Sending click events to Google Analytics in WordPress: the easy way

I'm trying to setup a link tracking on WordPress. There are several links to the same site, they all share the same class: <a class="gaClickTrack" href="https://www.amazon.es/Heromask-HeroMask-...
1
vote
2answers
53 views

How to include jQuery properly?

I have a script that requires jQuery, and I don't know how to add it into a post correctly. I've read How to include jQuery and JavaScript files correctly? and Using JavaScript and JQuery in Page but ...
-1
votes
0answers
12 views

How to display admin side images on client side in WordPress programmatically?

I am creating a WordPress plugin and I ask user to insert some images on the settings page of the plugin on admin side. Now when a shortcode is inserted in the post, I want to display those images on ...
0
votes
0answers
40 views

JQuery - Uploading image using Wp Rest API

I am trying upload an image to the wordpress media library with jquery from localhost. Here is my code function get_image_id(filename) { var img = new Image(); img.src = filename; //...
0
votes
0answers
28 views

How to use JS inside of the (iframe) wp_editor function?

I'm using the wp_editor function to create a cool frontend editor. The problem is: WP generates an iframe where the editor's content is displayed - however I have a hard time to do anyting with JS ...
0
votes
0answers
20 views

Save Search Criteria notification

I am trying to simply figure out how, after a user has saved a search on my site and wishes to get notified if anything new matching that search criteria has been added, can I then re-run the saved ...
0
votes
1answer
22 views

I'm trying to set the cookie to my site to button on click action ,it is working on when user logged in .When user logged out it's not working

function cookiebasedredirect() { ?> <script type="text/javascript"> jQuery(document).on('click', '#organisation', function(event){ event.preventDefault(); jQuery.cookie("...
2
votes
1answer
19 views

Hide/show customizer controls based on other settings in Customizer

This may be an easy one for those who know jquery. So, I have two customizer controls. First one is lmscore_improved_summary which is a checkbox. And the second one is course_instructor_layout. So ...
2
votes
3answers
60 views

wp_enqueue_script being ignored in custom theme

I am trying to enqueue a js file (calculator.js) from my theme's functions.php file. I have a desktop theme and a smartphone theme, and I am using a plugin to switch between the two themes depending ...
0
votes
0answers
106 views

Load more on button click scroll (no plugin)

I have a custom taxonomy in WordPress called Case studies. Home.php is a page. Within home.php I have ran a loop to get all the case studies: <?php // only display 5 posts at first, then load 5 ...
0
votes
1answer
54 views

Output multi-steps form results in same page

I'm trying to make a multi-step forms with radio buttons, which will be used to filter some custom posts. Here you can see an example. Right now, once the user complete and submit the form, the page ...
0
votes
0answers
25 views

Is wplink error “Cannot read property 'selectionStart'” solved?

I am trying to integrate the wplink function into my custom post type using custom fields. Unfortunately, I am facing following problem: Uncaught TypeError: Cannot read property 'selectionStart' of ...
0
votes
1answer
14 views

How to change the text of the “You are about to permanently delete these items…” alert message when deleting media from the media library?

This alert shows when you click Delete Permanently on a media (attachment) item. My Goal: I want to change the text of the alert if the current user has a certain custom meta value. Also, changing ...
1
vote
0answers
19 views

How to make an WordPress element sticky? [closed]

I'm trying to make an element sticky on my article. This is the element- Name: WP-Review <div Class=sticky-review> <?php echo do_shortcode("[wp-review]"); ?> </div> I tried CSS- ...
1
vote
0answers
22 views

Save Search System

I am trying to create a save search notification system whereby a user can search certain parameters on my site and save the search query like Ebay does or other classified ad websites do. I ...
1
vote
2answers
43 views

Use ajax from function.php

I am trying to make an ajax call and I am getting the error: TypeError: $ is undefined This is my function.php file: <?php // Add custom Theme Functions here // function ...
1
vote
0answers
41 views

adjust section according to country?

Mauritius + Mexico + Micronesia, Federated States of - Monaco + Mongolia + Montenegro + Morocco + Mozambique - Myanmar - Namibia - Nauru - Nepal + Netherlands + New Zealand + Nicaragua - Niger - ...
0
votes
3answers
61 views

Changing parent element's class or style

I added this bit of code to my header.php file: <script type="text/javascript"> $(document).ready(function() { if( $('div').hasClass('icheckbox') && $('div').hasClass('disabled') ) {...
1
vote
0answers
34 views

populate form fields in a loop with ajax

The first row only works in my row. <?PHP for ($i = 1; $i <= 20; $i++){ ?> <div id="lines" class="row"> <div class="col-sm-1" style="text-align:left;...
1
vote
1answer
16 views

Ajax Modal Flickers When Opened Multiple Times

on my Wordpress site I add a button that when clicked calls a modal to open via ajax. When I click the button once on a fresh reload of the page it seems to work fine without any hiccups. If I close ...
1
vote
0answers
152 views

dynamic dependent select dropdown

I have a dynamic dependent select dropdown system that selects vehicle makes and models from a database which works fine but I would like to convert it to use and select parent and child categories ...
1
vote
0answers
17 views

Accordion scrolls page too low after clicking on the title [closed]

Intro usually I trying to solve my problems at the code by myself, but with this one I need your help. I would like to say, that I tried all the solutions that looks similar, but I am not very ...
1
vote
0answers
18 views

How to embed JS data viz in a simple Wordpress website

I am just starting out with web development and JS. Is it possible to embed a data visualization created with Arbor.js in a static website created with such quick deployment tools as Jekyll or Hugo? ...
2
votes
1answer
68 views

Removing jQuery migrate and working with dependencies

I have jQuery setup in my enqueue scripts section as a dependency, such as: wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.min.js', array( '...
1
vote
0answers
134 views

Refresh Markercluster after ajax call

I have an ajax function that queries posts based on users by a certain role which is fine and works but the problem is that I am trying to refresh the markers on Google Maps after the ajax is complete ...
0
votes
1answer
16 views

Cannot use characters '<' or '>' in jQuery script in WordPress

While running my jquery script in wordpress I ran across this weird error. That does not allow me to use characters '<' or '>' in my script, any surrounding text just disappears during runtime. ...
1
vote
2answers
58 views

WP Admin missing icons, numerous JavaScript errors, but only when SCRIPT_DEBUG is false

I have access to a single Linux/Apache server where I'm trying to deploy WordPress. For purposes of this error, I've tested it with the default twentyseventeen theme and all plugins disabled. When I ...
1
vote
2answers
39 views

Wordpress site in China times out on requests to youtube [closed]

My wordpress site dj.pyromusic.cn is based in China, on a chinese server. Somewhere in the theme, or the site, it is making a request to youtube which is obviously blocked here, causing the load time ...
0
votes
0answers
28 views

Can't get next post info with ajax

I am trying to get next post id with ajax. Here is my ajax function. $('.gallery-next').click(function(){ var currenturl = window.location.href; var button = $(this), data = { ...