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
6 views

Disable, hide or remove IOS native select/drop down menu - Using select2

I have initialised select2 and done some styling which works fine on FF, Chrome, IE on PC and android... It also works on IOS, but when I click or touch the categories to launch the drop down / select ...
0
votes
0answers
9 views

WordPress Menu Item Script Dropdown Login

I have a client I'm redoing a website for on WordPress and I'm trying to implement a login system that when they click on the menu item at the top of their website, it has a login that drops out and ...
0
votes
1answer
18 views

wp_mail doesn't work when logged in?

I am having trouble with a wp_mail function I created, which sends an email when I press a button. It does work great when you do this logged out. But as soon as I am logged in it stops working. It is ...
0
votes
0answers
24 views

myStickymenu hide on scroll up to certain Y values

I am trying to implement this feature in plugin myStickymenu, so that the specific pane displays at scrolling down 500px (which works) and then hides again when scrolling back up to 1000px. I ...
0
votes
1answer
19 views

Wordpress ajax filter returning all posts when it should be filtering by category

Here is My code, it should be filtering by category, it displays all posts on any checkbox I click, I don't know how to fix this, I have tried everything. <form id="filter"> <?php ...
0
votes
1answer
5 views

Change Portfolio to show all same size grid?

Currently I am editting a website, I need the portfolio section to show all the same size images rather than it showing a long rectangle on the 2nd column. I thought it would be able to be fixed in ...
0
votes
2answers
15 views

How to show value using jqeury change methods after selecting value from two select options box? [on hold]

Jquery change will be executed only after selecting value from two select options. If I select one then it will show message as "Select two" or if I select two then it will show message as "Select Two"...
0
votes
2answers
24 views

Why doesn't my very simple jQuery work?

I just deployed a new Wordpress site. Everything looks good, now I'm setting up jQuery: Child theme functions.php: //enqueue scripts function my_theme_enqueue_scripts() { wp_register_script( '...
0
votes
1answer
13 views

How to add loaded or spinner until a ajax request is not completed?

My ajax request works fine: <script type="text/javascript"> $('#submitBtn').on('click', function(evnt){ evnt.preventDefault(); var ajax_url = '<?php echo admin_url("admin-...
0
votes
1answer
20 views

JQuery error: Woocommerce checkout field disabled (inactive)

Everything was fine until now. The payment field of checkout is inactive. I can fill in the billing details just fine. And the payment field flickers between inactive and active when I fill the ...
0
votes
0answers
23 views

Implement AJAX load more button in custom post loop

I need help implement a load more button in some custom loops in my custom wordpress theme. I'm experiencing some problems in the final step, I'm not able to print the function. This site is a ...
0
votes
1answer
20 views

Show and hide element when URL contains certain section of text?

I require #nav1 to display and #nav2 to hide on all pages which include "/category-1/" in the URL. I require #nav2 to display and #nav1 to hide on all pages which include "/category-2/" in the URL. ...
0
votes
0answers
12 views

using jquery events from wordpress frontend

i have used jquery on my plugin for events and ajax calls to consume rest apis but when i tried using events(click,hover...) but when i tried using it for front-end it is not working ,jquery works ...
0
votes
0answers
10 views

jQuery Repeater Remove Item and Subtract Value From Total [closed]

I am running into an issue that I am unsure how to fix due to being pretty new to jQuery. I created a repeater metabox for WordPress that is used for a proposal plugin which I am just about to launch ...
0
votes
0answers
14 views

Ajax when click back on browser

Please hell me, I would like to do so after reloading ajax if I enter in product data then after clicking back in the browser I would like to bring ajax $.ajax({ url : ajax_url, type : 'POST'...
0
votes
2answers
27 views

WordPress Menu adds an unwanted slash before anchor

I need a WordPress menu item to link to a custom url like the following: http://www.example.com/my-page#my-anchor Yet, WordPress adds a slash before the hash sign and reformats the custom link to ...
1
vote
2answers
22 views

Display WordPress the_content() via data attributes

Here is a test fiddle: my fiddle: https://jsfiddle.net/blogob/qtou84Lj/23/ I'm trying to build a full width map in a wordpress site with leaflet. My goal is to dsplay all post with markers on the ...
0
votes
1answer
29 views

Adding the jQuery to my theme that already exists in Wordpress?

I'm working on a custom theme in which it uses a custom script loaded like so in the functions.php file: function custom_scripts_method() { wp_register_script('custom_script', ...
0
votes
1answer
25 views

Dynamic input fields in WordPress Plugin

I am trying to create dynamic input fields in a plugin I am working on. I want to add functionality to "Add/Remove and Save" options in my plugin. Something like the below attached.
0
votes
0answers
16 views

Sending a static email to specified email address with jQuery in WordPress [duplicate]

Posting first time. I am using append function in jQuery. Its an a tag. I want to use that a tag to send an email when clicked. E-Mail body and subject will be static and on click email will ...
0
votes
1answer
21 views

How to add gif as preloader in wordpress?

I am trying to use a gif as preloader in wordpress. I want this gif to show exactly 5 seconds. I have found ways to do that in html/css/js but could not find how to do that in WordPress. I have found ...
0
votes
0answers
22 views

Jquery enqueued script in child theme not proccing

I created a child theme of the theme twenty-seventeen. I want to add some scripts, especially Jquery libraries and some custom Jquery to animate the homepage. This is what I have in functions.php (...
0
votes
1answer
18 views

Retrieve Woocommerce Cart Url with javascript/jquery [closed]

Is it possible to retrive woocommerce cart url using javascript or jquery? Are there native functions or do I have to perform an ajax call to retrieve it?
0
votes
1answer
34 views

Move Jquery.js to Footer

I want to move jquery.js from header to footer. I have tried following code: //Remove jQuery Default function replace_jquery() { if (!is_admin()) { wp_deregister_script('jquery'); } } ...
1
vote
1answer
43 views

Gutenberg Filtering Metaboxes by Post Format

In the classic editor, it was quite easy to show and hide metaboxes according to post format, using jQuery: if( ! $("input#post-format-gallery").is(':checked') ){ $( "#gallery-metabox" ).hide(...
0
votes
0answers
7 views

How to show other options when selecting certain option on custom widget?

Please have a look at an image and you will understand my problem clearly. I have custom widget to display the posts. As you can see image, i have layout of posts listing. Layout One and Layout two. ...
0
votes
0answers
133 views

Uncaught ReferenceError: jQuery is not defined

It is a well discussed problem, but I can't find the issue (I've been researching it for days now); Uncaught ReferenceError: jQuery is not defined jQuery seems not te be loaded within my custom ...
0
votes
1answer
23 views

Javascript output now showing in custom widget

I have an issue with Javascript that I created for my custom widget. Here is the code: var wrapper = $('#wrapper'), container; $.ajax({ method: "POST", url: "https://api.graphcms....
0
votes
0answers
21 views

Many buttons not functioning in WordPress dashboard (as admin)

I am having issues with many functions in the dashboard of one of my sites. For example, when I try to click on a tab in any of my plugins (e.g. to change settings), it doesn't do anything. Also, when ...
0
votes
2answers
77 views

CodeMirror on Custom Widget Textarea

I'm currently using this code within my plugin on a custom widgets textarea to enable codemirror. (function ($) { $(document).ready( function(){ var coinmedi_es_<?php echo $...
0
votes
1answer
32 views

Pass AJAX variable to PHP functions Wordpress plugin

I am creating a Wordpress plugin and using it to learn jQuery and AJAX. I have read many posts here on WPD and SE and on other sites but cannot get to grips with what I need to do (I am a real novice ...
0
votes
0answers
20 views

How to change event in slider

I want to change jquery event in the way that i turn off the slider and insert (keep) link to the another page. First page http://newlove.loveandbrands.rs/wp/en/artist-list/ and second page http://...
0
votes
0answers
17 views

How can i make this type of custom search in my wordpress website

I want to add a custom search on my homepage, how can I do this type of search engine in my homepage.
0
votes
1answer
27 views

Reset counter with jQuery [closed]

On WordPress I'm switching between categories of posts with a dropdown, and have a "load more" button that loads more posts into the selected category. Each time the button is pressed, a variable is ...
1
vote
3answers
28 views

Enqueuing javascript files

I'm trying to enqueue a JS file (located at /js/example-script.js), just to get an alert on page load. Can anyone tell me what I'm doing wrong? In my example-script.js: jQuery(document).ready(...
1
vote
1answer
90 views

How can I defer these JS files?

In my website, I used GTmetrix and I got JS defer error on following two files. 92.5KiB of JavaScript is parsed during initial page load. Defer parsing JavaScript to reduce blocking of page ...
0
votes
2answers
26 views

Gravity Forms - jQuery in List Field [closed]

I am working on this jQuery which will eventually populate fields from the Parent field (Features) to the Children fields (Description, address, etc.) within a List Field. I have been able to get the ...
0
votes
0answers
73 views

Woocommerce recently viewed products and page caching

I am currently using Hummingbird to cache my pages and I also use the Woocommerce recently viewed products widget. I am currently having to exclude my homepage from caching as when caching is active, ...
0
votes
0answers
17 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
27 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
2answers
310 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
0answers
9 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
99 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
1answer
84 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 ...
0
votes
0answers
8 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
13 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
59 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
41 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
14 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 ...