Questions tagged [javascript]

A client side scripting language useful for making interactive web sites. Questions about using JavaScript outside a WordPress context are off-topic but might be asked on Stack Overflow.

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

How to get Angular app working in Wordpress plugin?

I am working on a project that requires Angular to be loaded in a Wordpress plugin, and am running into some snage getting it working. After some trial and error, the final error I ran into was: main-...
0
votes
0answers
11 views

Content-Policy and Inline javascript/css

So I'm using wp_localize_script which I need for some javascript I'm running on the front. However the variable is that holds the information from localize_script (we'll call this variable "site" for ...
0
votes
0answers
15 views

WordPress AMP Plugin Blocking JavaScript [closed]

I have an issue in wordpress site, i have to use AMP Plugin for mobile page speed increase but,some javascript are blocked by AMP. I have to enable blocking javascript to unblocked what can i do. ...
0
votes
0answers
17 views

My Min Date is not working for the Date Picker using Elementor Form [closed]

I am working on my WordPress project using Elementor. In that, I have used Elementor form with date picker and I have write the code for min-date but it is not working. This is my Form with Date ...
0
votes
0answers
14 views

Dropdown menu not close after click inside

On my WordPress website I have a dropdown menu which appear when you click on item-menu "ESPACE PUBLIC" with 2 sub-menus ("TOUS LES PROJETS" and "CORNIL"). When I click on one sub-menu I get ...
0
votes
0answers
14 views

Add extra cost to shipping method itself in woocommerce

I found the following code from this link: https://stackoverflow.com/questions/52138784/add-a-fee-based-on-shipping-method-and-payment-method-in-woocommerce The code works great if you want to add ...
0
votes
1answer
23 views

I have a lot of JavaScript erorrs after SSL someone can help me?

I have a lot of JavaScript errors after SSL. Can someone help me? (https://validator.w3.org/nu/?doc=https%3A%2F%2Ffashionbymichal.com%2Fhe%2F) Also in the console: https://prnt.sc/qmnnzh
0
votes
0answers
9 views

Fetch debug information from WPML in $.ajax results in 403 forbidden

I am trying to fetch debug information from a piece of javascript, to make it easier to copy the debug information code (if find my self often doing this). However, when I send a request to a page, ...
-1
votes
0answers
12 views

My Homepage of website is not opening properly. Curser continue rolling up [closed]

I made my website in wordpress and facing problem in open it properly. I tried to clear all cashes and minify java script and css. Bu still has the same issue. Can someone help? www.biharaajtak.com
-3
votes
0answers
26 views

How can I convert this js file that wordpress accept/read it? [closed]

everyone! I'm new here and this is my first post! I have problem with java/jQuery and Wordpress doesn't accept this js file. Could anyone help me that how can I run this Js file in wordpress? I ...
0
votes
1answer
11 views

Multiple image selection custom widget

I've created a swiper custom carousel as template part of a custom theme. I want to widgetize this component of the theme to have more control over the contents displayed. It's used as an horizontal ...
0
votes
0answers
23 views

When adding google tag script in website, functionality not working

When i add google tag manager script in my wordpress website, user login, checkout functionalities facing issue.I tried with child theme as well as added script using plugins (google-tag-manage, ...
0
votes
0answers
28 views

Execute inline javascript in wordpress after page fully loaded

I am trying to find out the time it takes to fully load a page in wordpress using javascript.My JavaScript code is inline.I am using wp_print_scripts hook but as it prints scripts in document head i ...
0
votes
1answer
17 views

Is there a loading priority for login_enqueue_scripts?

I'm using this function to load my plugins (custom-logo-and-login) Javascript file in the footer of the login.php page, but the file loads right before the wp-includes main jQuery library: add_action(...
-1
votes
0answers
18 views

Set Default Value by two fields(attribute) in WordPress

I have some several fields in custom post code name ..... .... code name search(combination of code and name) -->Make field "Read Only" in UI anyway to concatenate code+name into 3rd attribute(code ...
0
votes
0answers
19 views

Vue and wordpress.Bad Request ajax request

First off, I'm not using wp in REST API mode. I'm simply using vue for an UI I wrote for an custom admin page. I'm using a development server spun up from webpack, I enqueue the scripts as so: ...
0
votes
1answer
30 views

Media library not working with wp_editor() on the front end

Very related: Add Media has stopped working in the front end since 4.5 update I want to run the wp_editor() function to load the classic WordPress editor on the Front-End. I need to do this out of ...
0
votes
0answers
10 views

Using a vue development (spun up by parcel.js) server with wordpress

I'm trying to develop an admin ui for a custom admin page using vue. I'm using Using the following article: https://premium.wpmudev.org/blog/creating-a-hybrid-single-page-app-wordpress-with-vuejs/ ...
0
votes
0answers
19 views

How to bridge the gap between dynamic back-end data and front-end output?

I wish to allow people to extend my system in any way they want while maintaining its integrity. For example, I have a component in my plugin called Notifications. These notifications are output to ...
0
votes
0answers
17 views

setInterval is not working in child js file

I am trying to use setInterval() into a script.js in a child theme. that was added in the functions.php child, any console.log() is working so the file is well linked. this is how I am using the ...
1
vote
0answers
33 views

How to load translation in JavaScript?

I am struggling to load translation in JavaScript for my simple plugin. Translation works for PHP, but not in JS. What seems to be the problem, how can I debug this? I have loaded text domain in my ...
0
votes
0answers
10 views

How can i remove one img src for existing and future post?

I have <img src="ex.jpg" alt="ex"/> any code to remove this image so i can set right first image as thumbnail
0
votes
1answer
18 views

The script works only once by clicking on the opening and closing

What is wrong with my code? What needs to be fixed so that the script always works on clicks of buttons? <script type="text/javascript"> // Выполнить асинхронный Ajax-запрос с помощью метода ...
0
votes
0answers
5 views

Custom block - check if post exists

I have custom block with saved attr of post ID. How can I verify from block definition that post with that ID exists in Wordpres. My aim is to warn user if post with saved ID exists no more.
0
votes
0answers
17 views

Wordpress Slider is not working

Currently I am developing my first theme in wordpress by converting html. In my front page (front-page.php in wordpress) there is a slide. It was finely working with html. But when I place it in the ...
1
vote
1answer
23 views

Modifying a .js Function for Print [QZ Tray, WooCommerce POS]

I'm sure this is an easy question, but I'm struggling to understand what I'm missing here. Skip to the bottom for the actual questions. Background I'm modifying a Wordpress POS plugin to work with ...
0
votes
0answers
17 views

Integrate leaflet / Openstreetmap autocomplete functionality to an existing search form on a wordpress template

I am trying to add the autocomplete functionality similar to what you have here https://community.algolia.com/places/examples.html#advanced to the search form in my website. Unfortunately there are no ...
0
votes
0answers
42 views

Calling php function using button onclick

I am using the following html button <button onclick="ga_cal_change_status(2300)"/> and I want to call the "my_message" php function from onclick event ga_cal_change_status(2300) passing the ...
0
votes
1answer
15 views

React to AJAX adding to the page

How can I have my JavaScript run every time AJAX finishes adding content to the page? My JavaScript file loads and runs, but only on first page load. I'm looking for the equivalent of Drupal....
0
votes
0answers
17 views

Multiple shortcodes with embedded JavaScript code in same page, how?

I'm developing a plugin that use shortcodes to display some "special" buttons on frontend. These shortcodes generate HTML, CSS and JavaScript for the button so, if the user insert multiple shortcodes ...
0
votes
1answer
25 views

Load script on frontend from widget plugin

I need a bit of help for a plugin I'm writing. I need to load a custom stylesheet and a custom script that are needed on the frontend only. Usually I use the wp_enqueue_script and wp_enqueue_style ...
1
vote
0answers
35 views

adding a script with type=“module” to woocommerce admin area

I'm trying to connect a my brother QL-800 label printer to a woocommerce webshop admin page open order, click address, print it. brother provides a javascript library (b-pac: https://www.brother.co....
0
votes
1answer
20 views

Is it feasible to call angular's page from wordpress website?

I have a static website on WordPress and there are 2 to 3 pages which has dynamic content and which does requires user authentication. So can I build these pages on angular side and call these pages ...
1
vote
0answers
28 views

Gutenberg Blocks doesn't render correctly when using do_blocks

I'm trying to render a post_content with blocks using the do_blocks function, that takes a gutenberg content, parses every block, and returns an HTML string. The problem is that some blocks aren't ...
1
vote
0answers
19 views

How to handle Gutenberg wp.data async errors?

When using wp.data.select('core').getEntityRecords(...), there is a special selector for loading states wp.data.select('core/data').isResolving(...). But what about actual errors -- backend validation ...
1
vote
1answer
15 views

wp_enqueue_scripts leads to error

I am adding a javascript file by hooking into wp_enqueue_scripts(). Here's the code: function order_tracking() { global $post; if ( $post->ID == 19851 ) { wp_enqueue_script('...
1
vote
1answer
35 views

How to filter a table in post content without plugins? [closed]

I found this feature Filter/Search Table in W3schools from this link https://www.w3schools.com/howto/howto_js_filter_table.asp I had tried to use it in my wordpress page content. The problem here is ...
1
vote
0answers
24 views

How to add material design css in wordpress and woocommerce

I am creating theme from scratch. I want to add material design css / forms / components and style in my theme. Can someone please assist me how to start. How can I disable default wordpress and ...
1
vote
0answers
10 views

Javascript file is not working on single.php wordpress [closed]

i have been included javascript file with wp_enqueue_script in function.php. it's working on index.php, but not working on single.php. does anyone have a solution???
1
vote
1answer
28 views

js file in root loading without <script src=

This is my first time using a js file. It controls the hover and display of images in a php menu file. They are both in the root directory. I have not referenced the file in the menu.php file at all ...
1
vote
1answer
37 views

How to show jquery popup only in one page or once?

i have this jquery popup but i need to show it only in the homepage. Here is the code: $(document).ready(function(){ $("#thover").click(function(){ $(this).fadeOut(); $("#tpopup")....
1
vote
1answer
18 views

Does costum code in the root folder get lost when wordpress is updated?

I have added costum JS and CSS in the root folder of the WordPress installation. If I update Wordpress, does this costum code get lost? See picture: smardigo is my webspace root folder and in the ...
1
vote
1answer
31 views

Create custom blocks for bootstrap

I'm reading the tutorial on how to create blocks for the Gutemberg editor. I want to implemente the bootstrap 4 grid, but I'm a bit confused on how to proceed. Can anyone explain to me what's the ...
1
vote
0answers
12 views

Uncaught TypeError [closed]

Uncaught TypeError: this.boxes.push is not a function at WOW.WOW.doSync at WOW.<anonymous> at MutationObserver.observe.childList can anyone tell me about this console error and solution?
0
votes
1answer
13 views

How can i show specific Category List?

By this code ,it shows all the category.but i want to show specific some category(like-Officer,Training) Thanks in Advance <?php // change category to your custom page ...
1
vote
0answers
19 views

Add new image block, set default class name and update it using Javascript

I am trying to programmatically set a default class on an image block, which is applied without the user manually adding it via the 'Additional CSS' field. I have tried applying a default style on ...
1
vote
0answers
33 views

Update an image block style programatically

I am trying to update the default classname of an image block that is being added to a page. In the editor backend view, I have a select drop down using ACF plugin, which programmatically changes the ...
0
votes
0answers
29 views

TinyMCE code works as Theme Template File But Not as Short Code

I have a strange problem I'm hoping you can help me with. The following code works fine in a template file for a theme. But it does NOT work as code in a class in a plugin for a short code. I am ...
0
votes
1answer
31 views

White screen when attaching css to function.php

When i attach below line code i get white screen and in console log it is getting below error my browsers are up to date Code body:not(.no-transition) #wrapper, .animsition-overlay { position: ...
1
vote
0answers
36 views

Set current tab on a Gutenberg TabPanel component from outside that component

I'm using the TabPanel component provided with Gutenberg to display some tabs. I'd like a button within one of the tabs to change the currently visible tab to another one and I can't work out how. ...