Questions tagged [scripts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
15 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
16 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
15 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
38 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
23 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
10 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
55 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
23 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
23 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
23 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
21 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
40 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
155 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 ...
0
votes
0answers
58 views

moxie.min.js and plupload.min.js

I want to make a defer to the following scripts but I can not find them in the documentation : wp-includes/js/plupload/moxie.min.js wp-includes/js/plupload/plupload.min.js I appreciate a help.
2
votes
1answer
352 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
47 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
26 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
33 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
188 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
0answers
174 views

How to add ID3 tag of a mp3 folder automatically when creating a WordPress playlist?

I am working on a mp3 wordress website. Currently I am uploading mp3 files using filezilla. After uploading I copy their url one by one and paste them in playlist post, then I need to edit mp3 title ...
0
votes
1answer
25 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 ...
0
votes
0answers
18 views

Support MagnificPopup for posts images

MagnificPopup requires the parent of the image to be a tag with href attribute contains the image link. After searching I found that the problem can be solved by add data-mfp-src attribute directly ...
2
votes
1answer
18 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
72 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
46 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
60 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
484 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
51 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
54 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
127 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
35 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
1k 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
660 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
319 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
53 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
285 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
365 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
42 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
61 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 =...
2
votes
0answers
15 views

How to add unique image class to Wordpress

I want my in-image ads to appear only on the first long vertical images of my blog posts. I need to add a unique image class to the first images, but I don't know how to do this or what code to use. ...
1
vote
1answer
648 views

How can I add my script to admin using script-loader.php?

I'm trying to load my custom script in the admin panel using the same method that WordPress itself loads scripts in the admin area. This is an example script being loaded by wp-includes/script-loader....
1
vote
1answer
680 views

Wordpress doesn't Load JQuery Now? Do I need to enqueue JQuery also?

In my HTML I was loading JQuery, but I am not loading it when converting HTML into the Wordpress. because I think WP automatically loads it. However there is a custom.js sitting in the js folder, and ...
2
votes
2answers
1k views

How does WordPress create its database during installation?

I am new to WordPress and I'm trying to understand it. I searched for a .sql file in WordPress script but couldn't find any. Wm kinda confused and want to know where the database entries and ...
0
votes
1answer
46 views

How to use custom Javascript code inside a plugin?

So, I have a custom Javascript code that inserts a pop-up widget in a webpage. The source code is irrelevant but it works by manually pasting before the <\body> tag of the website, such that: &...