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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
11 views

force preload jquery in header [closed]

I'm using the following code to preload the jquery script, and it works fine in the theme's header.php <?php function getWPVersion() { include '/wp-includes/version.php'; return $wp_version;...
user avatar
0 votes
0 answers
24 views

Hot to check if new posts have been published since page load and notify online users?

I want to show a div notifying online users that there are new posts since they have accessed the page, in the index and also if new posts have been added in the category or tag they are browsing. I ...
user avatar
0 votes
0 answers
10 views

Change Dropdown jQuery to show/hide but with default place holder that shows all

How to set the jQuery so if default "Department" is selected show all, and only hide all else one other section made. for example, if non selected will be "Department", if "...
user avatar
  • 105
-1 votes
0 answers
25 views

My enqueue javascript dont work?

This is my code in funcions.php wp_register_script( 'revaction', get_template_directory_uri() . '/extensions/revolution.extension.actions.min.js', ['jquery'], false, true ); wp_enqueue_script( '...
user avatar
0 votes
1 answer
24 views

Cannot read properties of undefined (reading 'firstChild') using photoswipe in product page

<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <div class="pswp__bg"></div> <div class="...
user avatar
0 votes
0 answers
7 views

Customizer control save then return to default

Is it possible with default wordpress controls to use the radio control then save then automatically revert to default after each save. For example radio select 0, 1, 2 is option and you select 2, ...
user avatar
0 votes
0 answers
30 views

wordpress mysql / wpdb ajax load more for terms help

Can anyone pls assist me with my problem. I am not asking for code, but even some guidance as to how to get this working. I have tried many ways, to get my terms to load using ajax load more and seem ...
user avatar
  • 16
0 votes
0 answers
13 views

Wordpress Select Option Load Custom Fields

I created a new post type called "Programs" and i created custom fields on Programs width Advanced Custom Fields plugin. I want to compare the Programs fields with each other on the page ...
user avatar
0 votes
0 answers
7 views

WordPress cascading dropdown selection search based on Parent Page & Child Page

How would I create a cascading dropdown select search where the first dropdown would host selected Parent Pages and the second to display the Child Pages of the selected Parent. When submit button is ...
user avatar
  • 11
0 votes
1 answer
33 views

Bootstrap and jQuery error: $ is not defined

I'm trying to use the Bootstrap collapse component and just can't get it to work. I believe the HTML is proper, but whenever I click on the element that should trigger the collapse, I get an Uncaught ...
user avatar
  • 13
0 votes
1 answer
28 views

is_page_template() written in jquery/javascript

With php there is a wordpress function is_page_template() Is there a similar function written in jquery/javascript? To use with the wp.customize api and jquery/javascript.
user avatar
0 votes
1 answer
34 views

Axis guidelines over an image

I'm trying to implement this in WordPress: https://stackoverflow.com/questions/11461913/making-axis-guide-lines-over-an-image-that-follow-the-mouse-pointer I created this script in my theme folder (/...
user avatar
  • 1
0 votes
0 answers
29 views

How to set javascript options for select2 in PHP array of plugin

I'm using two different jQuery plugins that I'm trying to get to work together. It should be possible since they come bundled together. The first plugin is the Metabox.io plugin for creating metaboxes....
user avatar
0 votes
0 answers
34 views

Custom WP rest api endpoint only working on non https?

I'm googling like an hour for a possible solution while im trying to create my first custom wordpress rest api endpoint. If i call the endpoint by postman it just works, but if i try with jquery, it ...
user avatar
0 votes
1 answer
330 views

Uncaught TypeError: Cannot read properties of undefined (reading 'message') [closed]

I wrote authentication for the entry and membership of wordpress. The code I wrote is ajax. not work Validation and redirect. But he gives the following error: Uncaught TypeError: Cannot read ...
user avatar
0 votes
0 answers
19 views

Trigger jQuery to add events after AJAX-loading table in admin plugin

I created a small Wordpress plugin which has some admin-panels. I am using the WP_List_Table class to display some data, but this HTML-table is ajax loaded. Because of the ajax-loading, jQuery doesn't ...
user avatar
  • 101
0 votes
1 answer
51 views

On click load iframe [closed]

I have this html <a href="#1647278006925-e8321147-313b" data-vc-accordion="" data-vc-container=".vc_tta-container"><span class="vc_tta-title-text">...
user avatar
0 votes
0 answers
13 views

Putting custom html/js page into Elementor as it's own block

I have a working custom html/javascript page that I created and then FTPd into my wordpress site as a custom template which I'm applying to a blank page. However, I have elementor pro and though I may ...
user avatar
  • 113
0 votes
0 answers
33 views

Tracking Visitor LatLng with Wordpress using JS, PHP. How to put data which was extract using JS into DB

Case: I tried to implement via js a geolocation tracker (not an IP Tracker). The code snippet is under Divi > Integration > Body Tag (Divi Page Builder). Afterwars i build via PhpMyAdmin a table ...
user avatar
0 votes
0 answers
21 views

Custom html/php/jquery map code in Wordpress/elementor?

I have some code I used for a searchable map with hotspots (basically a directory search, like airbnb searching for a location). So I’ve used this code for Joomla in order to have a search bar that ...
user avatar
  • 113
0 votes
0 answers
10 views

Long contextual help needs two clicks to close

In our plugin, we are using enough contextual help on one page that you have to scroll to reach the "Help" button (#contextual-help-link") to close it again. When this happens (or in ...
user avatar
  • 11
0 votes
1 answer
21 views

Ajax on the Administration Side of plugin - wp_localize_script - how to pass value from JQuery to PHP function in class?

I have built a plugin and I need to use ajax in the admin and have followed the documentation here: https://codex.wordpress.org/AJAX_in_Plugins However, this is out of date and I cannot find any ...
user avatar
  • 79
0 votes
1 answer
26 views

Ajax on the Administration Side of plugin - returns 0

I have built a plugin and I need to use ajax in the admin and have followed the documentation here: https://codex.wordpress.org/AJAX_in_Plugins However, the response I keep getting is 0. I know ...
user avatar
  • 79
0 votes
0 answers
49 views

Ajax add to cart not updating Elementor mini cart totals

I'm using a custom Elementor button to add products to cart, the custom button HTML looks this like: <a href="?add-to-cart=321" class="elementor-button-link elementor-button ...
user avatar
  • 96
-1 votes
1 answer
75 views

can't add EVENT LISTENER to a element

I'm trying to add a click eventListener to a element in homepage, it doesn't work. the event is not even added to the element. the above picture shows the html of the homepage. where I wanted to add ...
user avatar
0 votes
2 answers
33 views

Uncaught ReferenceError: jQuery is not defined - although jQuery is loaded [closed]

I'm aware that this is a well discussed question, nevertheless I did not find any answer for my issue. I have the following code on a Wordpress page (inline, necessary for this project): <script>...
user avatar
0 votes
0 answers
16 views

wp post_tag change minlength

I try to change minlength value from post tag search in wp-admin (wp-admin/js/tags-suggest.js) -> .fn.wpTagsSuggest -> options -> minLength but cant override this value
user avatar
1 vote
0 answers
89 views

Understrap child theme JS not working in custom-javascript.js file

I'm developing a Wordpress custom theme using the child-theme of Understrap. I'm adding my custom jQuery to child-theme > src > js > custom-javascript.js, and the file is already commented ...
user avatar
0 votes
1 answer
13 views

Database entry removed on browser refresh, Ajax PHP jQuery

I have a form that updates columns in a database table on submit of a form via ajax. Everything works great, the database table columns get the information however once the browser is refreshed the ...
user avatar
0 votes
0 answers
18 views

how can i include post meta in search result

I have made this code to search for post but i want to include search also show post that have this meta '_wp_manga_alternative ' the code i made if($_GET['s'] && !empty($_GET['s'])) { $text = ...
user avatar
0 votes
0 answers
62 views

wc_get_template_part doesnt display the content [duplicate]

hello guys when i try to loop products it's just display the div but not product info the image of the result function stsearch_products($data) { $args = array( 'post_type' => 'product'...
user avatar
0 votes
1 answer
23 views

How to load Javascript code or functions.php later in a child theme?

I'm placing some JS code in functions.php in my child theme but it loads first than anything else. Thus, I'm trying to get it to load later than the rest cos it needs Jquery. I tried enqueuing WP's ...
user avatar
0 votes
1 answer
18 views

wp not defined at wp.Uploader.prototype

I followed this code as below but it gives me the error "wp not defined". I placed the code inside footer.php in my child theme and also in functions.php but both are erroneous. (function($){...
user avatar
0 votes
0 answers
45 views

Jquery POST Ajax Return null data in wordpress

I really need help on this one. I've been looking at it for hours and been getting nowehere. I am working with ajax in WordPress and this is kind of my first time doing so. It's always return null ...
user avatar
0 votes
1 answer
44 views

How do I reinit Wordpress plugins dynamically using jS?

I've implemented a PJAX (push-state AJAX) library on my Wordpress site to handle page transitions, when the page content is updated everything is loading as expected except for Wordpress plugins. This ...
user avatar
  • 1
0 votes
0 answers
32 views

Wordpress AJAX Request returns 400

I am trying to make a ajax post request, however I a getting a 400 error, not sure what I am doing wrong. If you are able to have a look at my code, I'd really appreciate it. Below is the form. <...
user avatar
0 votes
1 answer
22 views

Run JS function when JQ enqueued

I would like to run a javascript function when jQuery is ready. This doesn't work: wp_enqueue_script('jquery'); ?> <script> (function() { doJQstuff() })(); </script> ...
user avatar
  • 21
1 vote
1 answer
38 views

Create URL with parameter for JQuery toggle status

Inherited a theme and cannot contact the original developer. In the site, there are toggles so that users can switch between English and Spanish versions of the content. The toggle JS is included in a ...
user avatar
0 votes
0 answers
21 views

How to locate the js code and php code for certain function?

For example, I want to debug the code for uploading an image when composing a post. I click the "Add Media" button, right-click on the "Media Library" tab, click the "Inspect&...
user avatar
  • 103
-1 votes
1 answer
29 views

Why not showing all post by default in my jquery filter

Hello Expert Developer, Can you please take a look on it, What i did messed up? function mysite_filter_function(){ //groups checkboxes if( $groups = get_terms( array( 'taxonomy' => 'category' ) ) )...
user avatar
0 votes
1 answer
139 views

splitting the URL using jQuery

Can i get the help of you guys as i want i can do it with url I need to split the URL. and use last element as job_id, And then pass "jkdbsbd45JubJKAAASSYT" as job_Id. URL: https://dev/job/?...
user avatar
  • 117
0 votes
0 answers
637 views

Can't get rid of JQMIGRATE: Migrate is installed, version 3.3.2. Manually updated all the libralies and site. 5.8.2

Answers I found here are about the older versions of WordPress when it were transitioning into a new version of jQuery. (This is version 5.8.2) Since the one from WordPress is not logging active, I ...
user avatar
  • 1
0 votes
0 answers
83 views

Fetch value using AJAX in WordPress

I am trying to fetch results using AJAX in WordPress.I put below code in functions.php. function get_data() { echo 'Ajax call output:'; wp_die(); } add_action('wp_ajax_get_data', 'get_data');...
user avatar
  • 377
0 votes
1 answer
31 views

Why does wp_head hook my functions to the beginning of my source code?

Why does wp_head hook my functions to the beginning of my source code, despite the fact that 'wp_head' appears in my code just before the tag. Below is the source code <php? function load_css()...
user avatar
0 votes
0 answers
40 views

Retrive username of the loged in user using jquery

I am trying to retreve the username of the logedin user and based on that take different actions. I tried using $the_user = wp_get_current_user() but I get, not defined error. Than i found this post ...
user avatar
  • 1
0 votes
1 answer
101 views

wp.media gallery collection sometimes undefined

I have a function that includes an external image-source into the media-library (wp-admin/upload.php), by making an ajax-call to said image-source, formatting the response appropriately and inserting ...
user avatar
  • 1
0 votes
0 answers
31 views

Script only works on wordpress home page & only when Jqurery is aded using <script type="text/javascript" src="> but not when jquery is enqueued

My Script that is responsible for showing a scroll to the top button only works on WordPress home page & only when Jqurery is added using <script type="text/javascript" src="/wp-...
user avatar
0 votes
1 answer
22 views

how to prevent added meta box from being injected with style="position: fixed; top: 56px;" at scroll down

This is my first attempt to customize WordPress. I added a meta box like this function settings_metabox() { //register custom meta box add_meta_box("mybox-id", "Settings", &...
user avatar
  • 111
0 votes
1 answer
22 views

Query data after an Ajax insert

After a successful insertion with Ajax of an entry I would like to see what the ID and url of that same entry is and show it in a modal window Any way to get that data? <script> ajax_url = &...
user avatar
  • 3
0 votes
1 answer
178 views

How to send a php var to jQuery Ajax call with two different file

I need to send a private e-mail address from a php file (page.php) to an Ajax Call in an other jquery file (sender.js). This e-mail address must be invisible to user/or website until the user get an ...
user avatar

1
2 3 4 5
47