Questions tagged [scripts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
42 views

How to add a PHP scripts into Wordpress

I have some PHP scripts around 60, which contains images that every 10 secs are refreshing, the source is from a live streaming server. My question is how to add them to WP? Some the code is on the ...
1
vote
2answers
24 views

Insert a button on a page with random number generation

I want to add a button on my wordpress page. When the user click on it, the text box above that button show a random number between 1-10000 I am quite new to Wordpress, I want to integrate some ...
0
votes
0answers
42 views

Why can I not deregister my style and script on custom post type?

I have a website where I have a custom post type with some single pages attached to it. Problem: I can't deregister the scripts and styles on my custom post type single pages. This is my code: ...
0
votes
2answers
84 views

Enqueue Script in custom plugin before other

I've got a conflict with another plugin which is blocking the JS in my custom plugin with the hook: add_action('wp_enqueue_scripts', '<FOREIGN-PLUGIN>'); Is there a way to enqueue my JS before ...
0
votes
0answers
37 views

How to use script in Wordpress installation?

I have a static HTML web page that I would like to recreate on a Wordpress website. The page has a fake survey with a series of questions. Users respond by clicking on one of several buttons which ...
0
votes
1answer
34 views

Unable to defer loading of jquery

I have two render blocking JS from wordpress core. jquery.js and jquery-migrate.min.js. Following this answer on WPSE I was able to add `defer="defer"' to the script tag that calls for jquery-migrate ...
0
votes
1answer
21 views

<script turning to <a href once published

I’m trying to add an league table using this script to a WP-page: <script src="https://www.palloliitto.fi/torneopal/ajax/[torneopal:scoretable:competition=splfutsal1920%26amp;class=FL%26amp;group=...
0
votes
0answers
65 views

Unload a woff file from Wordpress

I'm trying to improve the speed of my website. However i managed to eliminate all the uncessary file except for this that keeps showing up in Pageinsight (it takes 2.5 sec for the load time). I'm ...
0
votes
1answer
34 views

My scripts-bundle.js file is getting sent to the browser as a stylesheet css file. Help!

I'm new to WordPress custom theme development. I am using a child theme for OceanWP. I have a webpack setup to hot-reload my files but my js scripts are not getting sent to my WordPress site instead ...
0
votes
1answer
26 views

Changing URL of scripts, scripts outside theme folder?

Is it possible to have css and js scripts outside of template directory? If it is possible, how can I achieve it? Basically, instead of having: http://example.com/wp-content/themes/mytheme/assets/...
0
votes
0answers
12 views

Why aren't my custom js scripts loading from child theme?

I'm trying to override some custom js files in my child theme, and I have managed to get almost all scripts working, except for one script - the 'child-listing' script. All scripts load from child ...
0
votes
0answers
20 views

Replace content in several posts: Embeded video code (shortcode) with a new video player code

I have a wordpress site using old video plugin called FLV Embed and i want to replace it with any new video player code or any other video plugin shortcode. Currently this plugin uses this shortcode ...
0
votes
0answers
88 views

How do I add this OnClick event script to a custom button I’ve created?

I’ll start by saying (and it will probably be obvious) that I’m not very experienced in html or php coding. I’m learning some things as I’m creating this website, but I’m stumped with this one. I’m ...
0
votes
0answers
25 views

Scripts don't enqueue after removing plugin

Using the Ultimate Member plugin. My custom scripts are loading in my child-theme as follows: function some_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() ...
0
votes
1answer
17 views

Adding a “code checker” for my e-learning wordpress site

I am currently developing an e-learning platform with wordpress (using learndash) to teach python and I would like my students to be able to submit their python script on the website and get a mark ...
0
votes
0answers
14 views

Trouble running signature script

I am creating a document on my website which requires a customers signature. I have taken the signature element from https://codepen.io/nonsalant/pen/JYpjvE I have made some slight changes as I dont ...
0
votes
0answers
118 views

Python Wordpress- ImportError on certain python modules

I created a custom plugin to execute python in wordpress as seen here: Running a python script within wordpress It works well mostly, except certain packages in the python script yields ImportError ...
0
votes
0answers
49 views

List All Enqueued Scripts and Styles

Is there any way to list which scripts and styles have been enqueued, while within wp-admin? For example this code works, but only if you are on the frontend. How could I get the same list while ...
0
votes
0answers
40 views

Set Post Thumbnail to external URL

This question is with regard to feature images on WooCommerce product post types, however it should probably apply to any post type. I am running a custom script to create new posts (of type product) ...
0
votes
0answers
23 views

Prevent malicious scripts to be submitted in post

I am building a wordpress backed web application where users will submit posts. Is there any way to prevent malicious codes from being submitted (by way of hooks or filters)?
0
votes
0answers
35 views

How to use the WordPress API to get links and scripts in <head> and <body>

I'm using the WordPress API as a headless CMS. I have Elementor plugin installed to do page building in the WordPress admin. I'm trying to figure out how to get all of the <link> and <script&...
0
votes
1answer
24 views

Completely isolate a plugin view so it doesn't load the theme

We're making a WordPress plugin that generates an iframe with a shortcode, and that iframe that should work and display the same no matter what site, page or theme it's used on. The view is located at ...
0
votes
1answer
57 views

Wordpress 5.1 upgrade has lost the parent theme JavaScript

I have just upgraded from Wordpress 4.9 to 5.1, which obviously comes with Gutenberg. One major problem I have is that the parent theme (BeTheme) JavaScript is not being loaded and instead the child ...
1
vote
0answers
264 views

Repeating admin-ajax.php not found error in admin

I seem to be getting a repeating 404 error in the Chrome console when in wordpress admin very occasionally it gets marked as a 500 error for the same line, perhaps is something to do with an ...
0
votes
0answers
6 views

Printing extra scripts before src scripts to optimize minification and page speed

In WordPress a plugin may add extra data to be printed before or after a script when enqueueing a script. Quite a few plugins that we have enabled do this to define for example an ajax URL etc and it ...
2
votes
1answer
564 views

Select2 in WordPress

I have seen some best practices in WordPress about enqueueing scripts in WordPress. The scripts that are already in WordPress core should not be added again, but call that from WordPress core. I want ...
0
votes
1answer
60 views

How to Get Rid of Unwanted Backslashes in WordPress Form Input inside admin menu option

I'm building a simple plugin that allows adding custom scripts to header and footer. Everything seems to work fine, but there is a 'bug'. When I add Google Analytics script to header, it shows with ...
0
votes
2answers
27 views

Enabling plugin on specific pages and subpages

To increase the loading speed, I would like to only enable Event Manager plugin on the pages where it's actually used. For that, I wrote this piece of code: // deregister unnecessary plugin scripts: ...
1
vote
0answers
36 views

Styles and scripts inside template part

Is there anything wrong with including style and script tags inside a template part? The template part which I'm using like something more similar to a vue/react component is working correctly but ...
1
vote
2answers
215 views

Loading jQuery in the footer after removing jQuery migrate?

I am removing jQuery migrate in WordPress in this way: add_filter( 'wp_default_scripts', 'remove_jquery_migrate' ); function remove_jquery_migrate( &$scripts ){ if(!is_admin()){ $...
0
votes
1answer
27 views

How to generate/create link automatically on every word of post in wordpress

I am working on a poetry site and I am new to wordpress. I want to publish poems of various authors on my site. What i want is that when i publish a post, a link/onclick event on every word of post ...
2
votes
1answer
27 views

Unable to load stylesheets and scripts to plugin settings page

I have the following code in my main plugin file: <?php /* Plugin Name: Awesome Slide Show */ add_action('admin_head', 'wp_ss_plugin_include'); add_action('admin_menu', '...
3
votes
1answer
79 views

Why Allow Script Commands in Comments?

I noticed that if you are an admin or editor, you are able to put in script code like this in comments (not in the page/post editor) for admin/editor roles: <script>alert("Danger, Wil Robinson!"...
1
vote
1answer
57 views

Why won't my scripts load?

I am having trouble loading scripts in functions.php I've done this before so I'm sure I'm overlooking something but as far as I can tell it is correct and I have tried copying and pasting from other ...
1
vote
1answer
65 views

Writing scripts using Wordpress / WooCommerce classes?

I have various processing scripts I want to run that modify WooCommerce order data. Currently, I build the scripts as a function in my theme's functions.php and then attach the function to a shortcode....
0
votes
1answer
24 views

Add Custom Taxonomy into Script

I am trying to add a script for an affiliate widget into the back end of my website so I can use a custom taxonomy for the variable. Basically below where the script asks for destination I would like ...
0
votes
2answers
685 views

How can I load an inline script after the enqueued scripts in admin?

I am having a heck of a time finding an answer to this solution. I have googled everything I can think of but I can't find anything. I want to load an inline JavaScript tag in the footer of the admin. ...
0
votes
1answer
71 views

Hardening uploads folder in IIS breaks images

My site loads a bunch of images from the uploads folder, using direct URLs, such as: http://www.example.com/wp-content/uploads/some.image.png I'm trying to figure out a remote script execution issue,...
0
votes
1answer
60 views

how to call other plugins once custom post has been inserted

i built custom script to import woocommerce product using (wp_insert_post) and i want to call other plugins to insert their data to each new products to db for example: after inserting product if i ...
1
vote
0answers
156 views

Shortest script to install a WordPress webapp on Nginx

The following script is the one I use on Ubuntu-Nginx environments, to get a WordPress webapp up and running. I run it with a domain as an argument: bash ~/nwsm.sh example.com My question is what ...
0
votes
1answer
38 views

WordPress url transformation script

Does anyone know of or have suggestions for how to go about setting up a WordPress url transformation script - perhaps via a plugin or one-time run script? It would be used to correct installs which ...
1
vote
2answers
2k views

How to remove some external js files from source?

I need to remove some external .js files from source here is source: view-source:buhehe.de/ausmalbilder/ There is 3 jquery library and I don't know what is difference, why is it not one enough? <...
0
votes
2answers
833 views

wp_dequeue_style and wp_dequeue_script not working on server but does work on local xampp

This is my entire code and it is working perfectly in my local system xampp but not working on server. function taqyeem_dequeue_scrips() { if(basename($_SERVER['REQUEST_URI'])=='my_page' || ...
1
vote
2answers
421 views

Change directory of javascript files

I'd like to move all my assets (CSS, JS, Images, Fonts) in an asset folder in my theme. I did it very well for the fonts and images. For the CSS, I just kept the style.css with the style meta ...
0
votes
3answers
54 views

Using jquery with wordpress using wp_enqueue_scripts

I need to include jquery in a single page template of my theme. But it looks like it doesn't want to. I tried calling it with wp_enqueue_scripts() but i does nothing. Here is what is in functions.php ...
0
votes
1answer
393 views

style.min.css code issue

Okay, My site report is here that I am developing - https://tools.pingdom.com/#!/bBE0r0/www.waggypetservices.co.uk/ My only issue now is that something is calling style.min.css when this doesn't and ...
0
votes
1answer
19 views

Javascript asset not enqueuing with the rest

I am working on a project that uses the child-theme's functions file to enqueue a stylesheet and a single javascript file. These two resources are enqueued well. However, when I add a new compiled ...
2
votes
3answers
497 views

wp_register_script multiple identifiers?

In order to avoid poor performance with multiple <script> tags I do concatenation of scripts regularly and produce one single bundle.min.js JS file and 'jsbundle' identifier. Problem is, things ...
0
votes
1answer
58 views

Script not loading when depending on jQuery

As soon as I add the $deps array to my wp_enqueue_script, the script is 'enqueued', but not 'done'. Any ideas? function bootstrap_script_init() { wp_register_script('bootstrap', ...
0
votes
1answer
68 views

Enqueued admin javascript for plugin settings page not executing

Here is how I am enqueueing the script (this is inside a class): add_action( 'admin_enqueue_scripts', array( $this, 'add_admin_scripts'), true); public function add_admin_scripts(){ $parentBase =...