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

Questions tagged [jquery]

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
0answers
13 views

ERR EMPTY RESPOSNE on ajax delete request in wordpress

I am trying to delete a post with REST api endpoint. evry thing is working fine on local. but on live(000webhost server) its giving error with no response text. http://mylivesite/wp-json/university/...
0
votes
1answer
11 views

getting the values of hidden inputs to use them in a php mysql query

Im trying to update a value in the database, to do this I pass the values of the input an ID to another hidden inputs and submit the form via jquery, the values are set in the hidden input (tested). ...
0
votes
0answers
14 views

How to create a custom DOM event? [closed]

How to create a custom js event that fire a GTM trigger. im using Ninja Popup plugin and i need to fire a tag when a user subscribe through the newsletter form on that popup, luckily that plugin has a ...
0
votes
0answers
17 views

How to get Javascript to run using Scripts & Styles? [closed]

I'm an amateur when it comes to this, so I'm having trouble understanding how to patch this issue. I have this JS code: var acc = document.getElementsByClassName("accordion"); var i; for (i = 0; i ...
0
votes
2answers
46 views

Unset session variable on page reload / setup but exclude AJAX

I'm currently trying to unset a session variable in WordPress if the page get's reloaded. I've tried a lot but it's not working like I want it. This is my function: /** * Unset filter session if ...
0
votes
1answer
25 views

Contact Form 7 - on change event on select field [closed]

I want to add an "onChange" event in my select to get the value of the user selection and use it on a jQuery function. this is what I want: <select id="serviceSelection" onchange="saveSelection(...
0
votes
0answers
8 views

Javascript when Customizer preview is ready/refreshed?

I am trying to create a javascript which fires everytime the preview iframe is refreshed. I have found this one: wp.customize.bind('ready', function () { }); But this only works when the Customizer ...
0
votes
0answers
20 views

WooCommerce filter shop page without any plugin via AJAX

I've build a fancy dropdown filter at the top of the WooCommerce shop products list: The list gets filled from a custom product meta called hardness. It can has 3 values: big, middle and small. The ...
0
votes
0answers
34 views

enqueue script adds another .css with same name?

First I apologize if I'm not clear but I'll try to explain my problem with my enqueue script. I am trying to build a WP theme (conveting HTML & CSS Website) with existing files, but when I try to ...
-1
votes
0answers
26 views

strange behavior with update_post_meta

I am updating custom post meta values through a frontend form with ajax, and i have two fields, one is a select form and the other is a Bootstrap Datetimepicker input, which i've localized to Arabic. ...
0
votes
1answer
34 views

How to use `foreach()` in ajax call

I have written a code for retrieving data from the database using the ajax for WordPress. The following code is the one written in the functions.php. The code is for getting the id and names of ...
-1
votes
0answers
16 views

wordpress admin-ajax.php 400

Playing since hours around. Getting every Time a 400 and a return of 0. $('.save-date').on("click", function () { var pickrDate = $(this).parent().parent().find('.date-pickr').val(); ...
0
votes
0answers
7 views

Customizer input focused, change CSS in preview

I have created a javascript function which changes the css inside the preview when a input is focuses, this means I can bring up a modal when a text input is in focus. This works but as soon as I ...
0
votes
1answer
11 views

Remove button from page if viewed through Customizer

Is it possible to remove a specific button from the page only if it is viewed from the Customizer? I did try a check for wp-customizer in body, but this only checks the body of the iframe and not the ...
1
vote
1answer
17 views

How to handle 400 status in Ajax [duplicate]

I have created a page in wordpress which is hosted in localhost. The page containing two drop down lists. one is for selecting category lists from a table called 'category' and the second drop down ...
0
votes
2answers
34 views

AJAX Implementation

Am try to implement data from database using AJAX based on a drop down list in WordPress. The codes returning 400 bad request in the console. I am hosted the page as localhost. Here is my theme's ...
0
votes
0answers
12 views

Ajax javascript in Customizer only runs once?

I have a Ajax Javascript/jQuery function which refreshes the content of a div every 5 seconds. This works fantastically when the page is viewed from the front end. When viewing the same page in ...
0
votes
0answers
9 views

Perform javascript when an input in Customizer is selected/focused?

Can't figure out how to perform actions with javascript/jquery when a input is focused/selected in the Customizer under a section. I want to modify the content on the site in the preview when the ...
0
votes
0answers
13 views

Customizer clicking section, navigate to different URL?

I found this code https://make.xwp.co/2016/07/21/navigating-to-a-url-in-the-customizer-preview-when-a-section-is-expanded/ which explains how to do this. But for some reason it doesn't work for me. ...
0
votes
0answers
16 views

How to create responsive wordpress menu?

I am creating responsive menu in wordpress but I am not done. When Iam clicking on toggle then not open my menu. Please assist me jQuery('.navbar-toggle').on('click', function() { var elem = $(...
0
votes
0answers
16 views

Simple Ajax in WP: Always execute error block

myJsFile.js jQuery(document).ready(function($){ //sample variable that will pass to response PHP function var fruit = 'apple'; //AJAX Request $.ajax({ url: ...
0
votes
0answers
21 views

Add JavaScript to custom bulk edit

I used this guide in order to add a bulk edit to the orders. I want to add JavaScript code to it so I can bulk print the orders. When I am trying to register and enqueue the script, nothing happens ...
0
votes
1answer
102 views

How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress?

I am working on a WordPress website in which there are a lot of wordpress plugins installed. The plugins installed on the wordpress website has the following options: When I click on View details ...
0
votes
2answers
27 views

How jQuery Works in Wordpress [duplicate]

hy all, I have streaming site, and want to make a toggle button to switch to Dark/light mode using jQuery. please look to my code, what is wrong with my code, bcz this is not work for me. in footer....
0
votes
1answer
83 views

In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?

As it stands right now, in WooCommerce 3.5.1, at product archive (the /shop page), if you use the +/- buttons to set a quantity before clicking "Add to cart", all is fine. But if you try to actually ...
0
votes
1answer
15 views

Shortcode to pull posts

I need some help please. I have created a shortcode to pull in posts, then using ajax it loads more posts. I have everything working but it is duplicating the first group of posts. below is my code. ...
0
votes
1answer
12 views

Remove specific javascript when viewing page in Customizer?

I have a javascript which reloads the page when content change is detected. This is the behaviour I want on the main site. But when I use the Wordpress Customizer I don't want this behaviour as it ...
0
votes
0answers
21 views

AddToAny Share Buttons VS Ajax Load more

AddToAny Share Buttons are working for normal post. But when ajax load more button is clicked, the share button is generated with the new post but no share link is generated. The same is happening for ...
0
votes
0answers
14 views

Jquery getting selected image from media library to display on page that contains form

I'm trying to use Jquery to select the image selected from the media library on a form. Once that image is selected I'd like to use the image url on the page next to the form as a sort of preview. How ...
0
votes
1answer
35 views

JqueryUi Dialog giving Uncaught TypeError: this._addClass is not a function error

I have a site we needed some custom php coding to connect to an external database to grab product review urls for several vendors that sell our products. The basic idea we are trying to accomplish is ...
-1
votes
1answer
24 views

Can't access data from database using AJAX

I'm trying to make an AJAX call for the first time in wordpress. I followed some tutorial and have came to this point so far. But when I'm trying to console.log the data I get from database inside my ...
0
votes
0answers
19 views

How to remove jQuery from render blocking resources? [duplicate]

Is there any possibility to remove jquery.js and jquery-migrate.min.js scripts from render blocking resources? I see this error only on mobile, not on desktop. Scores in Google Page Speed Insights are ...
0
votes
1answer
13 views

How do I output user_registered time in my correct timezone?

I am currently using Wordpress, and an element of user_registered returns the time of registration of the user. I have set the correct timezone, but don't know how to get the user_registered output to ...
0
votes
1answer
12 views

Customizer add query to preview URL

In some part of our customizer we are redirecting users to some specific pages. var url = 'https://test.com/specific-page'; api.previewer.previewUrl.set( url ); We want to pass a custom query along ...
0
votes
1answer
28 views

How to add plugin with jQuery to custom theme?

I need to add carousel slider in my theme. It requires jQuery and jQuery is build in WP core. How can I add carousel script using this?
0
votes
2answers
51 views

AJAX pagination, update current page

I created a numeric pagination that loads the posts via AJAX. This is the PHP and jQuery code: // PHP Code function ajax_pagination_enqueue_scripts() { wp_enqueue_script( 'ajax-pagination', ...
0
votes
0answers
29 views

Input field duplicates on form submit by jQuery

I have a jQuery ajax function which adds some hidden fields to a form. I am trying to change the action of the form and then submit it using jQuery if ajax returns successfully. Here is the issue: ...
0
votes
1answer
22 views

How to disable a jQuery plugin on WordPress plugin page

I have created a WordPress search plugin for a customer. It worked at my site, but when I installed it in my customer's website it broke, because there is a jquery.formstyller plugin installed there, ...
0
votes
1answer
13 views

Ajax search shows all results when user empties input?

Just managed to get ajax live search working, which means I can get the results instantly when I enter characters in the input. The problem appears when I clear the input, it will show all results. ...
0
votes
0answers
14 views

Integrate HTML/CSS editor for website visitor

I want to integrate HTML/CSS editor for my WordPress website. So that when a visitor read my blog he/she can practice in that HTML/CSS editor. Check this sample link. How can i do that? Thanks
0
votes
1answer
19 views

jquery in wordpress plugin with depdendency

This is my first page of the plugin <?php /* Plugin Name: guard_search plugin Description: Search Plugon Author: mazhar */ ...
0
votes
0answers
50 views

Custom Ajax category search returns empty object

All components return what I expect except the final ajax success values: the object is empty. My admin-ajax.php location can be verified in console and returns the proper JSON values when I navigate ...
0
votes
1answer
55 views

Ajax call in WordPress - unable to display the data on the page

Ultimately, my goal is to obtain the latitude and longitude of the current user and then be able to save it into the database. Before that I need to make an ajax call from jquery and pass these ...
0
votes
0answers
7 views

WordPress AJAX not displaying content

I'm building a site within WordPress which will display two rows of images at the start, then on button click, two more, dynamically. I have four files involved in this process: case-study-card.php: ...
0
votes
0answers
29 views

Overwrite js code using WP_Footer

One of the plugin is en-queuing a js file in the front-end of my site. I was trying to overwrite it by creating a custom function and hooking it in WP_Footer. The js added by the plugin file is for ...
0
votes
0answers
34 views

Display Total Price based on Quantity Tier Pricing Model - WooCommerce

I am developing a WooCommerce website with a tier pricing model (using this Dynamic Pricing and Discount plugin). Products prices are fixed in advance and based on quantity bought (see table below). ...
0
votes
0answers
11 views

Ninja form does not auto depth on Chrome

Ninja form does not auto depth on Chrome or Safari page by pushing footer down (Wordpress), fine with WP Forms and Gravity forms. With single page form or multi-page forms of same height I have set ...
0
votes
0answers
16 views

jQuery code not working with theme

So im working on a site, a custom wp theme with a _s boilerplate, i've enqueue my styles and scripts which the browser picks up fine no errors; wp_enqueue_style( 'bootstrap-css', 'https://maxcdn....
0
votes
1answer
71 views

Ajax call not working anymore

I had a few functions I was calling with ajax...basically, everything was working as expected and now it's not. I'm not sure what could be causing this problem. I have a button on my page like so: &...
1
vote
1answer
105 views

Uncaught TypeError: Cannot read property 'replace' of undefined

I have used this jquery script on many of my sites with the same theme, settings, etc. It's in a wordpress Genesis Child theme. On my current local build, however, when I click on an a href that has ...