Questions tagged [wp-enqueue-scripts]
29 questions
2
votes
1 answer
Price inside Add to Cart shows only when there is a Sale Price
I'm using script to add the price to the Add to Cart in WooCommerce but for some reason the script seems to break when there aren't any variations set with a 'sale price'.
Would anyone have an idea why this is breaking? I have tried it in and…

Andrew Leto
- 31
- 4
1
vote
1 answer
WooCommerce enqueue style on shop page
I'm struggling to get a CSS file to load just on WooCommerce shop archive pages only.
Looking at the documentation I know there is a is_shop() tag.
So I would have thought
function kodr_scripts_styles() {
if( is_shop() ) {
…

alexkodr
- 523
- 3
- 7
- 30
1
vote
1 answer
Change JQUERY version on a single page Wordpress
I am not sure if this is possible or not and cannot find a solution.
I am trying to "deregister", "register" and "enqueue" the legacy JQUERY for a single page. This is not working when I add "&& is_page(251)" ?
Full code below and works great when I…

eberswine
- 1,224
- 3
- 20
- 39
1
vote
2 answers
Make checkout and my account company name filed read only. Make email address for my account read only in Woocommerce
Need to make an company name input read only in the checkout of WooCommerce and also in the My Account addresses (/my-account/edit-address/billing/) read only. This code below is working to make the email address read only and the company name on…

Bob Weiss
- 11
- 1
1
vote
1 answer
Javascript and Wordpress Uncaught SyntaxError using wp_enqueue_script on single product page of woocommerce
I'm no good at javascript but I think this code is right because it is just copy and paste from Zopim website and it was working before I tried to use their widget in a different approach.
functions.php

Cleber Reizen
- 420
- 4
- 11
1
vote
0 answers
nested JS Scripts are not included on wordpress page (using wp_enqueue_scripts in functions.php)
I have a problem with wordpress and wp_enqueue_scripts.
I want to include selected scripts only on specific posts.
For example: domain.com/post123/ <- script post123.js should be included. And to display the content within the post, I am using…

Waldgeist
- 29
- 4
0
votes
1 answer
How to load scripts in website front-end but not Elementor editor through functions.php
I am trying to enqueue a couple scripts and stylesheet on the home page of my website, but not have them load in the Elementor editor. As per this thread, I have used \Elementor\Plugin::$instance->editor->is_edit_mode() to determine if the site is…

David
- 144
- 1
- 12
0
votes
0 answers
How to add and activate react theme developed by npx-create-wptheme in wpengine
I have developed react theme for wordpress using npx-create-wptheme template it is running in localhost (xampp and wordpress) If I place react theme inside /wp-content/themes folder.
I have created sftp user on wpengine and I have placed the react…

Veera Silamban
- 223
- 1
- 14
0
votes
0 answers
Enqueuing on Wordpress not affecting script order
I don't deal with Wordpress or PHP really at all, our dev left last year and we've just muddled through really.
I'm fine with adding in scripts and what not, but this specific script has to be the first script loaded under the head tag.
I can't for…

kate
- 1
0
votes
0 answers
How to force wordpress to load block scripts in footer instead of head?
I'm currently using @wordpress/scripts to compile and load blocks script. Take a barebones block.json file like this:
{
"name": "myproject/counters",
"title": "Counters",
"description": "Blocco counters",
"keywords": ["counters",…

Luca Reghellin
- 7,426
- 12
- 73
- 118
0
votes
1 answer
Where is my mistake in the wp_enqueue_script?
I'm doing a portfolio. I didn't want to loose a lot of time but as newbie this is still difficult for me so i challenge myslef. So i took a template bootstrap and I want to 'import' the template on my wordpress website.
I used the wp_enqueue_script…

Pierro
- 1
0
votes
0 answers
wp_enqueue_style doesn't work but wp_enqueue_scripts works
I have a code like this
function fs_express_theme_styles() {
wp_enqueue_style( 'fs-express-theme-style', get_stylesheet_uri(), array(), filemtime(get_stylesheet_uri()) );
}
add_action( 'wp_enqueue_style', 'fs_express_theme_styles' );
that…

Dariia L
- 13
- 3
0
votes
0 answers
wp_head not injecting css (wordpress)
I'm trying to inject a style.css script into my front-page.php. I am able to load front-page's content by not link the style.css.
When you inspect page source, all the CSS should be there, but it simply shows the wp_head() script without injecting…

Shawn Esquivel
- 11
- 4
0
votes
0 answers
Finding error in my WordPress plugin template
I generated a WordPress plugin. However: When I include css and js file I get an error when I edit a page where I added the shortcode.
So what I do: I create a page, add the shortcode, it loads the plugin and my Hello World text. But then, when I…

Chris98
- 15
- 4
0
votes
0 answers
Enqueueing CSS & JavaScript files do not work properly when I try to convert HTML-CSS template to WordPress theme
I am trying to convert HTML template to a WordPress theme. When I try to enqueue CSS and JavaScript files, the website does not work properly as show in the attached image file. Do you have any idea what is the propblem?
function…

akramdeu
- 1