30 questions
1
vote
1
answer
69
views
Enqueuing some javaScript for a shortcode in a custom WordPress plugin
The following code works as expected on my WordPress setup, but when I send it to my friend who is running a cPanel managed version of WordPress, the JavaScript never runs. I can inspect the DOM and ...
-2
votes
2
answers
61
views
How to use the enque script function to disable right click on a wordpress site
enter image description here
Is there any way I can make this script load first or have my content protection plugins load first? Maybe even exempt certain plugins from being altered by seraphinite ...
1
vote
1
answer
1k
views
Remove WooCommerce styles and scripts
I want to remove Woocommerce scripts and styles from non woocommerce pages. I am trying code below but it's not working. I found the issue why it's not working, because woocommerce not setting priorty ...
0
votes
1
answer
974
views
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->...
0
votes
1
answer
176
views
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 ...
0
votes
0
answers
66
views
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 ...
1
vote
1
answer
1k
views
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(...
0
votes
1
answer
425
views
How to get this WP script_loader_tag working?
I've read about two dozen posts on here, but can't work out why this isn't working...
I'm enqueuing two scripts, then using a script_loader_tag to add type="module" to each tag. Scripts get ...
2
votes
1
answer
133
views
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 ...
0
votes
3
answers
2k
views
Is there a way to un-enqueue a WordPress plugin's script within functions.php?
A plugin vendor I'm getting support from recently suggested that if I didn't want a certain Javascript file within the plugin to be enqueued, I should go into the plugin's files and comment out the ...
1
vote
2
answers
685
views
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 ...
1
vote
1
answer
367
views
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....
-1
votes
1
answer
98
views
WP updating post_meta associative array with Ajax
I'm cycling through an associative array and adding each child array as a row in a table.
The last column in that table is a button in which I want to use to remove that array from the parent array in ...
1
vote
0
answers
102
views
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 ...
-1
votes
1
answer
299
views
WordPress enqueuing a CSS file using JavaScript inside Functions.php
I'm trying to load a CSS file just on mobile.
I made some research and found the the best way to do that is by using JS so here is the code I found:
$( document ).ready(function() {
var isMobile ...