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
0answers
10 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
24 views

How jQuery Works in Wordpress

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
0answers
39 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
12 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
9 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
14 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
8 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
15 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
15 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
16 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
0answers
22 views

Defer Inline JS without plugin

Hope you're fine! :) How can I defer inlined js codes without using plugin? I asked that because I can't defer jquery.js without deferring inlined js. ('' jquery is not defined '' error occurred). ...
0
votes
1answer
11 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
0answers
26 views

Move JQuery.js to the body (WordPress) [duplicate]

I want to move jquery.js from header to beginning of body (<body>) How can I do that for WordPress? Could you please give me a functions.php code for this? NOTE: I don't mean moving jquery 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
26 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
45 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
8 views

How to get select options IDs if option text exists in an array [on hold]

Say I have an array: var arr = ['a', 'b'] ; And I want to get all options IDs that have value of a or b from this select form <select id='letter' > <option id='one' >a</option&...
0
votes
0answers
23 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
13 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
17 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
40 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
48 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
9 views

How to use global variable inside JavaScript closure? [migrated]

I wrote a custom menu toggle code like below: var menu_trigger = $('.has-submenu > .nav-link'); menu_trigger.on('click', function(e) { e.preventDefault(); var this_menu = $(this); ...
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
28 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
18 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
58 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
54 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 ...
0
votes
0answers
18 views

Conditionally change a hyperlink url based on user role

I am looking for a way to change the destination URL of a hyperlink based on the logged in user's user role. I will have 3 custom user roles: Persona 1 Persona 2 Persona 3 The website will be a ...
0
votes
2answers
38 views

Get post content and show it in a div

I'm looking for a way to get a post content and show it dynamically in a div. My posts are shown in a list on the left of the screen, and i'd like to show the one you click in the right part of the ...
0
votes
2answers
19 views

Styling a specific post after hovering over it

Background My website is organised in a grid layout of four columns of divs. Each div is a container for a post and is a square of 200 x 200px. The title is a header at the bottom of the div and ...
0
votes
0answers
26 views

Simplest/Cleanest Way to Change the Default Twitter oEmbed Theme to Dark

The solution doesn't have to be in jQuery, but that's what I'm trying: jQuery(document).ready(function ($) { $('blockquote.Tweet').attr('data-theme', 'dark'); });
0
votes
0answers
19 views

Update shipping rate cost based on Postcode dropdown choice

So this one is a mind bogle.... I hope someone has the time for this one. Similar questions have been asked, but none have the solution to this, so please :-) Im using custom scripts to change ...
0
votes
1answer
29 views

Ajax in Plugins: returns the whole page

I'm developing a small plugin for a client and my ajax calls returns the whole page as json response. I cannot find the bug. In the plugin main.php: function __construct(){ //.. $this->...
0
votes
0answers
26 views

Building a logged-in user form that interacts with database

I am building a data-entry form for a wordpress website, strictly for logged-in users with editing capabilities. Conceptually, the user selects a database table from a list. The website generates a ...
-1
votes
1answer
16 views

How to resolve these findings from security audit

I am working on a corporate project and they are running security audit by consultants and they found the following issues regarding Wordpress. I managed to get a lot of issues resolved using headers ...
0
votes
0answers
11 views

How do i get post content after the click of the each sub tab of the parent tab?

I'm working on the custom template in this page I have added the JQery Tab in the, now how do I get content of each sub tab after click on it? I have created Custom Post Type in the admin panel ...
0
votes
0answers
22 views

How do i convert jquery static tab into wordpress dynamic post using custom post type?

I'm working on the WordPress custom page where I have added jquery ul tabs in the custom template page. 1) Now how do I get the content in the tab panel after the click on the sub-tabs of the parent ...
1
vote
0answers
18 views

Limit Widgets to Sidebar ID's

First, my English is not good, sorry about that. I have widgets. I want to limit them by sidebars ID's. I did that but it's working only moving widget left to sidebar areas. But when I reload page, (...
0
votes
0answers
13 views

wp-bootstrap-nav walker collapse is not working on ipad

Bootstrap navbar collapse is not working. The issue is that it shows a collapsing menu but on click, it is not collapsed. I have provided my full code so that it can help you to suggest or help me to ...
0
votes
0answers
23 views

How to use {{{ data }}} value into a javascript variable?

I have a line of code which I think is a js template placeholder when I use it like this it returns the value that I need "the price of a product" ?> {{{ data.variation.amz_price_var_uk }}} <?...
0
votes
1answer
26 views

How to include jQuery into my plugin so I can use it on plugin page?

How can I include jQuery file into my plugin so I can use it on plugin page?
0
votes
1answer
30 views

Dropdown (with onChange) with custom taxonomies

I have multi-select taxonomy field A. When one or more values are selected in A, I want to restrict the choices available in taxonomy field B. So for example: Two Taxonomies called country - "USA", ...
1
vote
0answers
29 views

Ajax post filters not working

I've been trying to create AJAX categories filters but I can't get the code working. I've followed these instructions : http://juha.blog/dev/wordpress/ajax-filters-for-wordpress-categories/ Edit : So ...
0
votes
0answers
40 views

Woocommerce input field not required if option selected

I have a WordPress site running Woocommerce and I setup a dropdown on the checkout page with 3 options for shipping choices. If they choose the first two options, two required fields show up for ...
0
votes
0answers
16 views

How to create an exit page in wordpress with 5 seconds redirect duration for all external links

I want to create a page for my blog, which contains a custom redirect page content. When a user on any external link from the whole site, it redirects to that page and there I want to display a ...