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 [javascript]

A client side scripting language useful for making interactive web sites

0
votes
0answers
14 views

How do i load javascript on a specific custom post template via functions.php?

I want to load some javascript on a custom post template called progress-posts.php. Using: if (is_page_template( 'progress-posts.php' )) { wp_enqueue_script( 'progress-box', ...
0
votes
0answers
28 views

How to remove p / br elements from gutenbergs editor

We updated to Wordpress 5.0 on our website, problem is that this includes the new gutenberg editor. Before this I already removed the WP function that sometimes places <p> and <br> ...
0
votes
0answers
18 views

How to retrieve data from database, then pass it to Javascript?

I'm trying to select a column from database like so: global $wpdb; $results = $wpdb->get_col("SELECT start_time FROM admin_form_entry"); $start = $results[0]; Then, I send data to external ...
0
votes
0answers
22 views

How to get after hash word from current page url

I've been developing a filtering with mixitup including hash url filtering support in Wordpress. But one of the task, I need to catch up the after hash word and have to pass it into pure php string as ...
0
votes
0answers
22 views

How to add classes and events to image in javascript using Gutenberg?

Before WordPress 5.0, manipulating the content in the editor using javascript was fairly easy: add_wp_tiny_mce_init_script to add your script in the TinyMCE iframe profit The script I include in ...
0
votes
0answers
8 views

postMessage callback from Customizer?

I use transport postMessage on my custom customizer settings. This works really good, but I am looking for a way to detect when the postMessage has been called. Right now I change a setting, and the ...
0
votes
0answers
14 views

How to create a custom DOM event? [closed]

How to create a custom js event that fire a GTM trigger. im using Ninja Popup plugin and i need to fire a tag when a user subscribe through the newsletter form on that popup, luckily that plugin has a ...
0
votes
0answers
12 views

How to integrate Angular 6 app with WordPress theme? [closed]

How to integrate Angular 6 app with WordPress theme? I have already created a full project in WordPress but in that one section Alone I have developed in Angular 6 so now I have to integrate both. ...
0
votes
0answers
8 views

Wpforms snippet condition date+7

I want to limit the input in a datefield to (minimum) today+7. I found the snippet below, but i don't know how to customize it. Anyone that can help? (Sunday may be available) /** * Limit the dates ...
1
vote
1answer
16 views

Integrating PHP into Javascript to display map markers with Google API - problem with wp_localize

I would display Google maps markers on custom site temple with Google API maps. I do everything like this post: Integrating PHP into Javascript to display map markers with Google API But a console ...
0
votes
0answers
17 views

How to add the downloaded item name in New Order email in WooCommerce?

What code should I add in the WooCommerce 'New Order' admin email to include the name of the downloaded file with a digital product? Default email does not include any info on the product ordered (...
1
vote
1answer
48 views

Side effects of Script and Iframe in post

I am writing a post on HTML. Afcorse the post will have Codes in it. So for showing results in the post, I am taking help of JSFiddle, by embedding results of the code. JSFiddle gives two methods for ...
0
votes
0answers
25 views

Assign variable of Wordpress plugin to value of a javascript variable

I know there should be a way to achieve this but, unfortunately, I’m a newbie to PHP and I really need your kind assistance here. I spend hours to find a solution, have no hair left to pull out of my ...
0
votes
0answers
12 views

Warning message on sensitive image

In a post with several big images, I'd like to put a warning message on some of them, so the user has to click on it to display the photo, as Twitter and Facebook do on some content. I haven't found ...
-1
votes
0answers
16 views

wordpress admin-ajax.php 400

Playing since hours around. Getting every Time a 400 and a return of 0. $('.save-date').on("click", function () { var pickrDate = $(this).parent().parent().find('.date-pickr').val(); ...
-1
votes
0answers
6 views

How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?

I want me to move the product info (name, price) from under each Woocommerce product image on the shop page to only be seen via Featured Image Rollover (instead of the current rollover info.) Pretty ...
0
votes
0answers
5 views

Custom JS Gallery problem

I handcoded some content (single html file with css and js insterted inside) for 16 tabs created using FusionBuilder (theme: Avada) on my site. Code is inserted via [Code Block] element inside the ...
0
votes
0answers
4 views

How can I synchronize input HTML field at all times without using a button, keystroke or window load? [migrated]

Where am I going wrong in trying to have the "City" input field always equal the "City Repeat" field? I do not want to use a button, keystroke or window load event because a separate JavaScript file ...
0
votes
0answers
11 views

WP Simple & Clean In Article Polls

I've been looking for a simple poll to place in articles where people can select an option and see results immediately without having to register, etc. I was sent this example from https://www....
0
votes
2answers
39 views

How should I identify the inline javascript that is the dependent of a wp_enqueue_script?

I want to run my own JavaScript on a specific WordPress page but only after a third party's plugin runs as I am trying to slightly modify that plugin. My problem is that my JavaScript is running ...
0
votes
0answers
12 views

Display all description with the same taxonomie in google map marker using ajax

For the moment I can not display all the descriptions related to the same taxonomies. I only display the most recent alert. my goal and to display the descriptions of all alerts related to each ...
0
votes
0answers
12 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
18 views

Why Can't I get the data-div working in this navigation menu in a WordPress theme using Bootstrap?

I'm having a very difficult time getting a navigation working on this site which is a WordPress site using a Bootstrap starter theme. I inherited the site and would like to get the navigation working ...
0
votes
1answer
29 views

Remove CSS & JS from <?php wp_head(); ?>

I've been with this problem for a couple of days and the truth is that I can not find a solution. I have added code manually in wp-header.php and now I need to delete these lines that it generates ...
0
votes
0answers
13 views

Customizer clicking section, navigate to different URL?

I found this code https://make.xwp.co/2016/07/21/navigating-to-a-url-in-the-customizer-preview-when-a-section-is-expanded/ which explains how to do this. But for some reason it doesn't work for me. ...
1
vote
4answers
33 views

How can the plugin directory path be returned into <script> </script>?

How can the plugin directory path be returned into <script> </script> instead of hard coding the path? Here is the custom-page.php: <?php get_header(); ?> <script type="text/...
0
votes
0answers
9 views

JS gallery does not work properly inside tabbed content

I handcoded content (single html file with css and js insterted inside) for 16 tabs created using FusionBuilder (theme: Avada) on this site. Code is inserted via [Code Block] element inside the ...
0
votes
0answers
13 views

How to Add Custom Value Box to Quick Edit Screen on wp-admin?

I am trying an Coding for Adding My Custom Field at Quick-Edit Page. But Not working, Can anyone help to make it work for me based on my custom function name (written below) Here is Code which i am ...
0
votes
1answer
37 views

How can javascript be added to a custom-page.php template?

How can javascript be added to a custom-page.php template? How can the following javascript gotten from w3schools ajax tutorial be made to work from a custom-page.php template? Any help would be ...
0
votes
0answers
8 views

Divi full screen popup/modal

I have a page built with the Divi editor and I would like a popup to appear when I click an image. I understand that I would need to use javascript onclick events, but where exactly do I put the HTML ...
0
votes
0answers
21 views

Add JavaScript to custom bulk edit

I used this guide in order to add a bulk edit to the orders. I want to add JavaScript code to it so I can bulk print the orders. When I am trying to register and enqueue the script, nothing happens ...
0
votes
1answer
102 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
0answers
18 views

Woocommerce checkout field autocomplete and delivery by city

I am trying to implement a customized delivery option given by the city the user has chosen. In order to do so, I started with adding a basic js autocomplete on a closed list of cities, The problem ...
0
votes
0answers
21 views

How to make iframe with variable content length responsive?

Following on from my previous question here, I am trying to embed html files into WordPress posts using oEmbed. The embed itself was successful, but the problem is that contents of each html file is ...
1
vote
2answers
41 views

Modals using loops and ACF [on hold]

I am trying to make a page that queries every post of a specific category ("attractions"). I have been able to get the posts successfully, I just need to make the modals work. I have made a button ...
0
votes
0answers
34 views

Redirect url on https localhost using social login for Facebook

I'm currently using the current code for Facebook social login on a website I'm making. Under my opening body tag, I have this: <script> window.fbAsyncInit = function() { FB.init({ appId ...
0
votes
0answers
21 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
1answer
35 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
0answers
17 views

wp_enqueue_script loads my javascript before DOM elements are ready

wp_enqueue_script loads my javascript before DOM elements are ready even with boolean to load in footer set to be true. I have a html elements on one template page and a separate script.js file with ...
0
votes
1answer
29 views

Wordpress ajax error 400 bad request for sending data to remote site [duplicate]

I am using Sender.net for email subscription lists. This site give me some information to add user's emails to subscription list. I want to use WordPress ajax to for this. but it return error 400 bad ...
2
votes
1answer
169 views

Trigger Javascript on Gutenberg (Block Editor) Save

So I have a metabox which I want to trigger some Javascript when a post is saved (to refresh the page in this use case.) In Classic Editor, this can be done via a simple redirect hooked to save_post ...
0
votes
1answer
22 views

Ajax call from Plugin using Class

I'm making a plugin with a class and methods. This class gets called through the theme ( hard coded ) to enqueue and localize my js. it also prepares it for ajax. However, i keep getting ERROR: 400 ...
0
votes
0answers
18 views

How to hide the other product categories in the shop page when a specific one is opened?

in my shop page (WooCommerce), I have a sidebar on the left side showing all the product categories. I would like to hide SOME OF those categories in the sidebar when you click a specific category ...
0
votes
1answer
13 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
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
0answers
23 views

Add class to body after page has loaded

I would like to add a Class called "snap" to the <body> tag only on two templates (the front page and on my single Custom Post Type page 'projects'). To do that I don't have any problem. But I ...
0
votes
0answers
17 views

Enqueueing Script in child theme not working

I am using Avada Child Theme that comes packed with AVADA Package. I have created a folder named "JS" inside the child theme folder and put a scripts.js in that folder. Here is the Code that I have ...
0
votes
0answers
14 views

Access state in parent higher-order component

I'm trying to develop a WordPress Gutenberg block here. How can I reformat my code to be able to have access to the searchTerm state (defined in the class) in the parent higher-order component defined ...
0
votes
0answers
26 views

Enqueue CSS and Script only if needeed

How can I enqueue a CSS code only on the pages which use that CSS? Usually it's quite easy to know if a particular CSS or JS is used on a WordPress Post: it's enough to check if the shortcode is used ...
0
votes
1answer
20 views

Background Music WP [closed]

this may be a stupid topic but a client has commissioned me this: some music to be included in some pages. I can not find any plugins to help me do this. Do you know anyone? Now, I was thinking if you ...