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

Can't Listen to KeyDown in TInyMCE Iframe (jQuery) and Pass it to Parent HTML FORM

I am trying to build an HTML form with TinyMCE textarea such that on Clicking Ctrl+S, it submits the form, by clicking the SUBMIT buton of form. I am using jQuery, here is the KeyDown jQuery(...
0
votes
0answers
5 views

Add new variable product attributes form

So I have to create new product page where users are going to be able to choose between different purchase options in dropdowns, upload their designs on order, etc. So my initial idea was to create ...
0
votes
1answer
18 views

post value to function with Ajax and jQuery

This is how you would create a custom smart tag in wp forms: function ea_custom_smart_tags( $content, $tag ) { if( 'my_smart_tag' == $tag ) { $value = 'Testing 1 2 3'; $content = ...
1
vote
1answer
45 views

JQuery calling a Custom PHP function (Works in Dev but not in WordPress)

My code is working fine on my localhost in my development environment which is outside of the WordPress press environment. I know the PHP function is working. I am able to send test votes to my ...
0
votes
1answer
33 views

How to display comments length

i used this code for limit comment length add_filter( 'preprocess_comment', 'wpb_preprocess_comment' ); function wpb_preprocess_comment($comment) { if ( strlen( $comment['comment_content'] ) >...
0
votes
0answers
24 views

how to unescape wordpress output

I am having to hook into a plugin and I need to actually output a value I get via jQuery. However, when I try to return it (I have to use return) it just escapes the javascript instead of actually ...
0
votes
0answers
10 views

Filtering an autocomplete by a custom post type in Wordpress using Ajax

I've been following the below post in order to set up an ajax autofill input on my search. Populating autocomplete field with custom post type Unfortunately, I keep getting the following error: ...
1
vote
1answer
17 views

How to set callback to execute after all the tinyMCE editors have been initialized?

I've loaded a tinyMCE editor using wp_editor function of Wordpress. Now, I want to set value of that editor after it gets initialized. I tried to do it like this: $(function() { tinymce.get(...)....
0
votes
0answers
8 views

inline javascript only executing in firefox [closed]

So i have a simple script to change an image when a button or tab is clicked on. The script works fine in firefox but I cant even execute anything in my script in edge and chrome. There is nothing ...
0
votes
0answers
10 views

update_post_meta is not working for me when I use e.preventDefault for update button

This is the what I'm doing at WordPress dashboard. I'm working on WordPress plugin, and trying to save my input fields data against the particular product when the update button is clicked for the ...
0
votes
0answers
28 views

WordPress Ajax - Filter Posts by Category

I'm having trouble getting this Ajax tutorial to work - if anyone is able to help me figure this out it would be much appreciated. I followed the instructions step by step and have gone over the code ...
1
vote
0answers
9 views

Disable stored tags queries in admin page when posting a new post

First of all, I am sorry because I am a bit newbie here and I am still learning forgive me, please. I have a Wordpress website blog and I have a very big database of tags stored in MySQL the problem ...
0
votes
0answers
28 views

Required/Mandatory fields in WordPress Admin

Looking for a solution for WordPress Admin where fields such as Title, Excerpt, Category are required before being able to publish. Warning message or alert displaying what is missing because it is ...
0
votes
0answers
8 views

Pass Category Name, Description and Photo into variables to pass to jQuery

Currently I'm trying to get the category description by ID so that I can use it in jQuery. I'm finding jQuery will only let me use echo $variablename and not the usual echo that can display the ...
0
votes
2answers
18 views

Adding css and js to a blank page created with custom template

I am new to wp, fair warning :) I have added a new blank page by adding a php file in the twentytwenty theme folder with: <?php /* Template Name: charles */ ?> Then, I have created a new ...
0
votes
0answers
22 views

I have an trouble in my wordpress theme. The error is “Uncaught ReferenceError: theme_scriptspf is not defined”

This is message from console of Chrome: Uncaught ReferenceError: theme_scriptspf is not defined at HTMLDivElement.<anonymous> (ajaxlist.js?ver=2.0:45) at Function.each (jquery.js?ver=1....
-1
votes
0answers
8 views

Jquery not working in code, but working in console cart page pop up

Jquery not working in woocommerce cart page. I have made the pop up product on cart page and displayed some products. Now selecting the quantity but it's not working. But when i am running the jquery ...
-1
votes
1answer
86 views

Change image on post title hover (more than one instance) - Jquery

I created a loop of posts from terms having a block for each term like the following: - Term title Featured image of one post from that term List of all posts for that term - Right now I'm using ...
1
vote
1answer
26 views

Load More Posts Button - AJAX

I'm trying to add Ajax to my theme so I can load my posts dynamically. The following code works but for some reason when I wrap the button that fires the loading with another div it doesn't do ...
0
votes
1answer
17 views

WordPress live search and filter custom fields

I have the following code intended to fetch, filter and display custom post on input(onkeyup). However, it sin't working at the moment; I also get a 500 (Internal Server Error) when I open the console....
0
votes
0answers
17 views

WordPress live search and filter

I have a grid of posts on my archive page. How can I filter through them once I start typing on the search bar, or filter by category on click, please?
0
votes
2answers
23 views

Need help about understand api, wp, $ syntax in WordPress plugin script

I really new in Wordpress development and have a little bit of knowledge of jquery. I was trying to understand a WordPress plugin and also trying to understand the js code they wrote for the plugin. I ...
0
votes
1answer
17 views

Customize the “Available for back order” text for specific variation

In Woocommerce, on the product page, i want to customize the "Available for back order" text for specific variations (size L and XL). So when a customer selects size L or XL, the "Available for back ...
0
votes
2answers
35 views

How to pass bloginfo(url) in a jquery

I need help in getting this to work, i want to pass the site url in a jquery window.location.replace("URL") And i want it to work like this window.location.replace("site_url/contact-us") My whole ...
0
votes
0answers
15 views

If user has clicked link add class and store using PHP/Wordpress

I have multiple divs on my website that are clickable. I simply want that when the user clicks this div, a class is then added so they know they have viewed this. For example, we could have a list of ...
0
votes
1answer
56 views

Trying to Load jQuery

I'm trying to load jQuery but I can't seem to get it to work properly. On this page here: https://koehlerrice.com/about-3/ I'm trying to get the image to fade from one color to another on the page ...
0
votes
0answers
13 views

JS conflict with Wordpress

My owl slider doesnt work on wordpress while it works on html. here is the html: http://hekim.deniz-tasarim.site/wp-content/hekim-offline/live/page-gallery-fancybox.html I copy paste the html code ...
0
votes
0answers
11 views

Conflict or another problem

I have a html page.It has owl slider and it works perfectly.you can see the html page on this link: http://hekim.deniz-tasarim.site/wp-content/hekim-offline/live/page-gallery-fancybox.html I ...
0
votes
1answer
20 views

Remove escape characters from JSON string pulled from a database

I'm pulling rows that contain JSON content from a DB like this: <?php //get the data from the database global $wpdb; $current_user = wp_get_current_user(); $username = $...
0
votes
2answers
16 views

Embedding CodePen Calorie Script - jquery error

I'm trying to embed this code: https://codepen.io/jme11/pen/zMVJVX into my Wordpress about fitness, but I don't know why it's not working correctly - I've downloaded the export of the code, which ...
0
votes
0answers
12 views

Website always load twice on start

This is the website Whenever you open the website it loads first and then disappear for a second and loads again. I don’t know what is causing this issue but it is very annoying. Any advices what can ...
0
votes
1answer
34 views

How do loop categories post from according in WordPress? is it impossible to solve this problem?

I have to get help from Tony about build accordion WordPress but in the loop, its repeated the same three posts and I don't know how to make a loop with the right way when clicking on category I must ...
0
votes
2answers
21 views

Cannot get custom javascript to execute on page

I have a simple piece of "hello world" code I'm trying to execute on a page. I'm adding it using a PHP snippet: add_action( 'wp_head', function () { ?> <script type="text/javascript" src="https:...
0
votes
0answers
12 views

Unable to use Datepicker in a table when inserting a row

Here is the html code for which the datepicker works- <div class="container"> <div class="row"> <div class='col-sm-4'> <form> <...
0
votes
1answer
13 views

How can I get this menu container to be the height of the contents?

I have a menu that was created using Bootstrap 4. I am using CSS to show all sub menus on the opening of the main li (Products). Everything is working as expected however the container is not ...
0
votes
0answers
210 views

Woocommerce add to cart quantity buttons with AJAX

I have on every page (product pages, single product page) plus and minus buttons next to the quantity to add up, next to the button a add to cart icon in AJAX. I can't figure out 2 problems: Issue 1:...
0
votes
1answer
12 views

Slick slider for post doesn't display anything

I want to make a testimonial slider with slick from https://kenwheeler.github.io/slick/. i use WP_Query for get the post with specific category. the slick works finde but it doesn't show the content....
0
votes
0answers
27 views

Can I get product name using added_to_cart trigger

I am using added_to_cart trigger to display an alert box and in this alert box I want to display product name. I do not know whether there is any way to get product name or not. Here is my code ...
0
votes
0answers
15 views

Load jQuery 3 for one script only, then revert to 1? [duplicate]

I've got an issue with jQuery. Since WordPress "refuses" to update the jQuery 1, and I need a higher one to run a simple script containing the function $.trim, is there anyway to just load jQuery 3 ...
1
vote
0answers
40 views

“TypeError: ((n.event.special[g.origType] || {}).handle || g.handler).apply is not a function” error from jquery.js?ver=1.12.4-wp library

I'm getting an error in console Uncaught TypeError: ((n.event.special[g.origType] || {}).handle || g.handler).apply is not a function at HTMLDocument.dispatch (jquery.js?ver=1.12.4-wp:3) at ...
1
vote
0answers
15 views

Adding Custom Slider

I having a few issues adding code to functions.php to implement a custom slider. The code is below. I'm struggling to find out what I am doing wrong. // Slick Slider wp_enqueue_script( 'slick-js', ...
0
votes
1answer
28 views

How to enable read more by default using jquery

I have a question and answer website and using a custom wordpress theme, which has the option to enable read more link using jquery. When i click on read more link, it expands full content of the post ...
1
vote
0answers
12 views

show element on page load from external url only [closed]

I am trying to load a div on page load (every page) but only when the page is visited from an external source. Google for example. What I have is currently loading on every page load internally,
2
votes
1answer
54 views

Problem with WordPress Ajax form

I am trying to save data from a form to user meta using ajax, however I am unsuccesful. I am pretty new to jQuery, and am not sure where I am going wrong, as there don't seem to be any suntax errors. ...
0
votes
1answer
23 views

JQuery is not working after complete load of the page

Hi i have a strange problem with wordpress. I have a short JQuery script. The script is working as long as the page is loading. But when the page is finished with loading it's not working anymore and ...
0
votes
0answers
28 views

UIkit/yootheme Pro Offcanvas hiding

I'm working on a wordpress website: http://marioorsi.sviluppo.host/ with Youtheme Pro installed and based on UIkit Framework. I need to hide offcanvas menu when user clicks on an anchor link (Chi ...
0
votes
1answer
19 views

Custom Post Type Slick Slider “$ is not a function”

I'm trying to create a slider with my custom post type rt_testimonial. I believed I had everything setup but I'm getting an error in console: TypeError: $ is not a function Here's what I did: In ...
0
votes
1answer
18 views

Update $wpdb query with AJAX

I display a list on my website with a custom database table : $resultats = $wpdb->get_results( $wpdb->prepare( "SELECT photo, nom, prenom, titre_fr, departement_fr FROM {$wpdb->prefix}...
0
votes
0answers
21 views

show background color in sticky header with jquery

i have a problem on my site. I have started this site with GeneratePress Pro + Visual composer, and i build everything with VC. Now i have a problem: with the vc documentation i made a transparent ...
0
votes
2answers
53 views

Use one javascript variable into another javascript file

This is common.js jQuery(function ($) { var commonJs = { init: function () { }, showAlert: function () { }, } }); This is add.js jQuery(function ($) { ...

1
2 3 4 5
43