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.
2,374 questions
0
votes
2
answers
104
views
Output parent/child categories and posts in that parent/child hierarchy
I'm using the WP_Query loop to output all categories and their posts into a jQuery accordion, using the category name as the accordion header, with posts from each category inside each accordion.
The ...
-1
votes
2
answers
55
views
Cannot establish AJAX connection ('400 Bad Request')
Im trying to create a very basic AJAX script that shows a random post title, just so I at least know I can get AJAX to work.
But I keep getting a 400 error in the Chrome console.
I've been checking my ...
0
votes
2
answers
54
views
Insert selection from filter everything pro into gravity forms field
I have a couple of different things happening on one page, and I need to have the selections pulled from an elementor filter form to populate a gravity forms field (ideally a hidden one).
I have this ...
1
vote
1
answer
103
views
JQuery is not a function error in console
I have a Woocommerce site running the latest version of Woo and WP. The theme is Flatsome (latest version).
Recently, I am seeing a "jQuery is not a function" error in the console which ...
0
votes
1
answer
149
views
Issues with WooCommerce: jquery.blockUI.min.js
My site works very slow and it's impossible to start editing in Elementor. The issue I've found, that I'm not sure if it's causing is:
MESSAGE TYPE: (Javascript) TypeError
PROBLEM DESCRIPTION: t....
0
votes
0
answers
23
views
Add/Remove User Meta Array via AJAX
I'm trying to create a simple "favorite" product list. Basically, when viewing a list of products someone can click a button that adds it to your favorites.
The idea is, they click the ...
0
votes
0
answers
27
views
How do I ensure that the URL parameters are updated correctly when multiple filters are applied
I am writing a product filter, and ran into this issue.
I have 2 different attributes of my product filter:
Tilt -- as a checkbox with "Yes" or "No", and Multibrand Compatible -- ...
0
votes
0
answers
31
views
Filtered queries not responeding to page path
I am writing a product filter, and ran into this issue.
I have 2 different attributes of my product filter:
Tilt -- as a checkbox with "Yes" or "No", and Multibrand Compatible -- ...
0
votes
0
answers
33
views
Set Featured Image Grab Image ID or Image File Name
Is there way of to grabbing "Image ID" or "Image File Name" after attaching a featured image (post-thumbnail) to page?
I am looking to capture that ID so that I can validate the ...
0
votes
0
answers
76
views
How to ajaxify all pages of my Wp Site
I want to ajaxify all my wordpress site pages, how to do that. Is there a plugin for that? Please guide. thank you
0
votes
0
answers
47
views
How to save Wordpress post and attachment images from front end using media library?
I'm developing a wordpress page to submit a post and its images attachment. I don't use input type="file" instead use jQuery wordpress media library.
frame.on("select", function (...
1
vote
0
answers
100
views
.modal(), .tab, .tooltip is not a function jQuery
Our site has been getting these recurring errors which I cannot track down and just needed some guidance. Each error revolves around jQuery and Bootstrap 4.6 methods as not a function. Here's what I'...
0
votes
0
answers
34
views
allow multi carousel in same page
I have this code for slider, i need help to edit it to allow multiple slider in same page.
var all_divs = $('.px-carousel-container .px-carousel-item').length;
var i = 0,
n = 0;
let ...
0
votes
1
answer
265
views
'Add Media' to post - filter images
Can anyone help me with this? ...
I am trying to locate and understand the javascript and/or php/ajax code that filters the thumbnails that show in the interface when a user clicks "Add media&...
1
vote
0
answers
144
views
slider i want move 4 images every button click
I have this code for slider button, i want move 4 images every button click. and make the button not active when all images slides if right or left. (sorry if my English not good)
$(document).on('...
1
vote
1
answer
90
views
Metabox conditionals depending on post format and template in Gutenberg
In the classic editor, I used jQuery to display metaboxes depending on the current post-format or page template selected. If a user selected a different format or template, they would toggle depending ...
0
votes
1
answer
153
views
Pull total post count for child category and parent if term ID
I have a mess of code that works, however I know its a mess and im sure there is a neater way of doing this.
I am trying to get the child category to display under the parent category and for the post ...
2
votes
0
answers
93
views
Can't find elemnts on the DOM using Custom Control in Customizer API
I'am creating a Custom Control on Customizer API, I add Multiple Checkbox as my custom type.
When I wanna add a live preview, the jQuery doesn't find the selector that I want.
Here's functions.php ...
1
vote
1
answer
73
views
Ajax response from Media Selection does not update ALL information more than once
I don't quite know how to explain what is going on, or how to title my post but I'm going to do my best.
I'm making my first plugin for WordPress, which is very simple.
Allow the user to select a file ...
1
vote
1
answer
58
views
Help with jquery/ajax requests
I have 2 forms on my page that I need to submit and stay on the same page. The first form works fine, but the second form will go to the admin-ajax.php page.
First form/jQuery and Ajax request
Like I ...
0
votes
0
answers
81
views
JQuery UI Autocomplete showing as bullets
The JQuery UI Demo page for autocomplete has a nice looking search box and drop down. When I implement it in my plugin, I end up with a bulleted list. How do I get my drop down of suggestions to look ...
1
vote
0
answers
47
views
Why jquery arrray return 0 value
The array in this function return 0. I am unable to figure out what the problem is.
function custom_woocommerce_auto_suggest() {
$search_query = sanitize_text_field($_POST['search_query']);
$...
1
vote
1
answer
83
views
Translating the "Everything" filter menu in Quicksand jquery file
I have been using QuickSand Jquery to display my WordPress portfolio.
Everything is working well. I just added the polylang plugin and would like to be able to translate the first item of the filter ...
0
votes
1
answer
119
views
How to make WP Classic Editor required in jQuery
I have tried to validate the post content that must not be empty. Here are my codes:
// HTML codes for Classic Editor in HTML mode:
<textarea placeholder="Describe Ads here" ...
0
votes
0
answers
82
views
JQuery UI Autocomplete/Autosuggest Wordpress
I am creating custom search bar with category dropdown in my wordpress woocommerce site but auto-suggest not working showing response array 0 in console.What's wrong with the code? I am a beginner i ...
0
votes
2
answers
124
views
jQuery - Make multiple field Required with warning at WP Admin backend
I would like to use jQuery to validate two fields on NEW/EDIT page of a Wordpress website in a way that When either of both fields are empty and Publish button is pressed, there is a warning:
Please ...
1
vote
0
answers
159
views
Custom plugin translation not working
I made a plugin that contains 2 custom gutenberg blocks created with react and jQuery (for some front-end stuff) and I'm having troubles translating them. There are no translation strings inside the ...
0
votes
0
answers
69
views
Help with creating commenting system using PHP, jQuery and AJAX
I am working on creating a comment system for an events plugin I am working on. I've got the main comments working fine with them saving to the database and displaying on the page. What I need help ...
0
votes
3
answers
163
views
Help with AJAX request
I am creating an events plugin with a commenting section for each event. I am able to save each comment, but the problem I'm having now is that I am taken to admin-ajax.php which is blank. When the ...
0
votes
1
answer
39
views
Update shortcode values using ajax call
I'm having a problem with a calendar, I've made a shortcode which returns events links in a grid that shows the current month view.
I set $month_index in order to navigate through months (default is 0 ...
1
vote
0
answers
354
views
How to add new ACF repeater row after removing all rows using jQuery/Javascript
I am creating a custom ACF Field within a page edit screen which I have added a div container, outside the container is 3 buttons. Add text block, add image and save.
I also have a repeater field (I ...
1
vote
1
answer
237
views
add_post_meta when jQuery button is clicked
So I have this code that's using jQuery on click. It fills the heart: https://jsfiddle.net/69ww31n3/
Here's where I'm struggling, I want when the heart is clicked it would add_post_meta key 'heart' ...
0
votes
1
answer
209
views
Wordpress Media Uploader not displaying image that has just been uploaded
I am trying to implement a custom WP Media uploader within a plugin. I want multiple images to be uploaded also.
I have the following javascript to open the media uploader. The modal opens fine and ...
0
votes
0
answers
164
views
ajax select parent show child in another select and show posts in another select-ajax filter search
I'm on wordpress and I created a search filter shortcode which user can select province and show towns on another html select base on province and when user select town, in another html select it must ...
0
votes
1
answer
346
views
How do I remove/hide embed excerpts from posts
How can I remove post excerpt from internal links that are embed as posts to custom WordPress page.
https://prnt.sc/6e07tjSht5i7
I cant do it with classic CSS styling , I guess due to the iframe/embed ...
0
votes
0
answers
1k
views
Custom jQuery code in Elementor page is not working on Mac os. On Windows browser work fine
Custom jQuery code in Elementor page is not working on Mac os. On Windows browser work fine.
I make small jQuery script for tabs and put in Elementor page.
On all Windows browsers is working fine, but ...
0
votes
1
answer
3k
views
Injecting CSS into Iframe
I have added an iframe to my website.
Within the I-Frame is an area which is not required and I would like to hide.
I have tried to inject CSS into the i-frame using
Functions.php
add_action( '...
0
votes
0
answers
72
views
I'm trying to register with AJAX
I have tried this
add_action( 'wp_ajax_custome_ajax_email_check', 'custome_ajax_email_check' );
add_action('wp_ajax_nopriv_custome_ajax_email_check', 'custome_ajax_email_check');
function ...
0
votes
1
answer
234
views
How to change the text of Publish Button
I am trying to change the text of the publish button to save.
I could change the text.
BUT, When I click Status Edit button and OK button, it change "Publish".
How can I fix this?
This is ...
0
votes
1
answer
53
views
Enqueued jQuery not working
I am trying to change a label on the add new page for a custom post type, but I am having trouble getting any jQuery to operate.
In functions.php, I am enqueueing my script file, after first verifying ...
0
votes
0
answers
65
views
get_post_meta returns on side but it doesn't return on bottom of admin page
I have added a custom image upload option in custom CPT page and here is the screenshot -
The image is showing well in side bar of admin page after updating a post, screenshot-
But when I add that ...
0
votes
0
answers
194
views
Unable to correctly include jQuery in a legacy Wordpress application with multisites
Our legacy multi-site Wordpress application with Wordpress version 6.2 and jQuery version 3.6.4 was working fine so far. We did a PHP upgrade, from version 7.2 to 7.4. Since then, jQuery is not ...
1
vote
2
answers
681
views
CF7 Populate Text Field Based On Checkbox Checked
I need to be be able to auto populate a text field with "one-hidden" when a customer checks a checkbox but so far examples I've found online do not seem to work or im putting them in the ...
0
votes
2
answers
1k
views
AJAX call not initializing for non-admins in WordPress
I developed my ajax functionality while using a WordPress admin account and everything worked correctly. Testing as a user, however, I cannot get the functionality to call - and pressing the "...
0
votes
1
answer
817
views
How to access Elementor-navigation-elements via jQuery
I am currently working on a custom WordPress-Plugin in which I need to extend the menu of the Elementor-plugin (the menu on the left when you edit a page or post via Elementor). For some reason I am ...
0
votes
1
answer
276
views
Insert meta-description into Yoast-SEO input-field via JavaScript
we're currently working on an extension for the Yoast-SEO WordPress-Plugin. One of the features of this extension requires the meta-description within the Yoast-SEO-area to be replaced via JavaScript ...
0
votes
0
answers
99
views
Jquery with Variable Name when using WP_Localize_Script
When using wp_localize_script()
How do you write jquery/js with a variable variable name.
This is normal:
$('#goodword').focus(function(){
$('#goodword').css('background','inherit');
}).blur(...
0
votes
1
answer
89
views
Making the Google Maps API non readable
Our former developers created this code below. However, when it renders on our site, it displays the API key. Is there a better way to hide the API key while still enlisting the script to be executed?
...
0
votes
1
answer
1k
views
slider wont load unless you scrolldown on mobile, slick.js carousel
I use slick.js for my carousel. Everything is working fine on desktop but in my mobile I have this weird problem where the slider doesn't load correctly until I scrolldown. Have anyone here also ...
0
votes
0
answers
70
views
Can't seem to check off a category checkbox with jquery?
I've got the following simple jquery test script to test if I can check off a category box in the right sidebar when creating a new post:
jQuery(document).ready(function($) {
console.log('js file ...