Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

2
votes
1answer
14 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
45 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
0answers
27 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
50 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
0answers
25 views

How to get WP-CLI to work with bash scripts?

I have wp-cli installed on a WHM/cpanel server running multi-php versions with EasyApache4. I am able to use wp-cli when Im either in the directory where wp-config resides or I use the –path command ...
0
votes
1answer
13 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
12 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
26 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
28 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
63 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
15 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
599 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
292 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
131 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
49 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
76 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
12 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 ...
1
vote
3answers
184 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
25 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
41 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 =...
1
vote
0answers
14 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
300 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
289 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
478 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
31 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: &...
0
votes
1answer
59 views

Why is JavaScript being added to header as application/oembed?

I created a short JavaScript file and placed it in my theme's JS folder, the contents of the file are: /** * Text2Give Functions File * * Mobile Landing Page Functions File */ jQuery( function( $...
0
votes
1answer
33 views

Automatic Wordpress Clone Backup

I currently manage a website for my company - entirely internal, only employees can view. This website is very important for the company's workflow throughout the day, and database information for ...
0
votes
1answer
519 views

Add table to WordPress database

I want to add an extra table on my WordPress database and I intend to query it with a custom script that will be embedded to WordPress. I'm worrying if this is a safe way to do it, or I should go ...
-3
votes
1answer
130 views

Change color of a specific word generated by script [closed]

I'm trying to adapt a code to change the color of a single word, but I have no idea how. The original code is crypt_single_getPar = eval('(' + httpGet("https://api.cryptonator.com/api/ticker/" + ...
1
vote
0answers
25 views

Custom tag being removed from text editor

I have visual composer installed. I have a special "weather widget" that I need to add to a page, but it keeps getting stripped when I add it into a text block. <wx:widget type="alerts" template="...
2
votes
1answer
346 views

Disable unneeded scripts in a wordpress installation

I have inherited a quite bloated wordpress website that runs really slow even on dedicated hosting. I am trying to optimize the speed of it. I have run the website through different websites that ...
0
votes
1answer
37 views

How can I get my Media Uploader Button to function on 1 click rather than requiring 2 clicks?

UPDATE: I have corrected the below code, to reflect the answer which resolved my issue. I have created a Custom Admin Page and have managed to get all of my Fields and Save buttons to work. Within ...
0
votes
2answers
201 views

Load scripts for do_shortcode( ' [ my_shortcode ] ' )

I want load some scripts and style only for a specific shortcode. I used if ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'my_shortcode') ) {} It works when I put my ...
0
votes
3answers
2k views

adding script tag in head of specific pages

I just added a new page which needed some javascript to pull json(with setInterval) and display content in that page div tag, On digging i discovered we can add script tag in themes/header.php file . ...
0
votes
1answer
65 views

Adding javascript to header of MetroMagazine theme

I am currently working on http://cryptoportugal.com/ and I'm still starting on Wordpress and I got stuck trying to add a javascript script (widget) to my website header. The script is the following - ...
0
votes
1answer
1k views

How to avoid loading same script twice?

Lets say the case is "owl carousel". 1- Should you register it as "owlcarousel" or "xyz-owlcarousel" with your theme / plugin prefix ? 2- If 2 or 3 theme / plugins use the same handle "owlcarousel" ...
0
votes
1answer
45 views

How to get, in WP page's script, a wp enqueued script (in Functions.php)?

I’m very new to WP, and to JS as well, and need to do a simple change to existing code, so forgive my ignorance… For getting the current User Id I followed examples and added an action + function to ...
0
votes
1answer
2k views

wp_enqueue_script was called incorrectly Issue when active plugins of WordPress Admin Bar Improved

I am getting the error with the following message when i active my plugins "WordPress Admin Bar Improved": Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be ...
0
votes
2answers
111 views

Order of WP page load (including widgets, php, plugins, media, templates, and CSS) [duplicate]

In what order does WordPress resources (e.g. templates, php files, media, plugins, widgets, enqueued scripts, and CSS) get loaded? I am new to WordPress and there is some basic info I have been ...
2
votes
2answers
2k views

How to properly add Bootstrap and JQuery Javascripts?

I am developing my WordPress theme using Material Bootstrap Design (MDB), a Material variant that uses Bootstrap 4 plus its own code. It calls for using the following scripts... <!-- JQuery -->...
1
vote
1answer
25 views

By having WordPress in a subfolder does it mean more script executions?

By having WordPress installed in a subfolder / directory does this mean WordPress will do more script executions then having WP installed at the root level? Edit: The root level index file has 645 ...
1
vote
1answer
100 views

How to cancel `wp_print_scripts`?

I want to load all the scripts in $wp_scripts with my own JS function after the window.onload event. Is there a simple way to prevent wp_print_scripts from printing the default list of <script> ...
0
votes
1answer
37 views

Styles and Scripts, Selectively enqueue across entire site

Right I have a plugin I am making for a customer, this plugin is actually to display things on a window TV display they have which will connect to a webpage not linked publicly on the website. I am ...
7
votes
2answers
6k views

How can I get a list of all enqueued scripts and styles?

I'm creating a plugin and I want to get the list of all scripts and CSS used by other plugins. This is my function: function crunchify_print_scripts_styles() { $result = []; $result['...
0
votes
2answers
48 views

Can I customised default WP table

I have a XML file that consist of product information. Format of XML file : <product> <name>Product-1</name> <description>this is product 1 description</...
1
vote
0answers
42 views

wp_print_scripts runs twice

I am currently using a child theme of the Hueman theme. I am filtering the different JS scripts, page by page. So, I use the following function, in order to display which scripts are used: // ...
0
votes
1answer
335 views

How to serve wp-includes javascripts from CDN? [duplicate]

My goal is very simple to describe: I want all JS from wp-includes to be served via my CDN (cloudfront to be specific). This just means I need to change the domain from: http://mywebsite.com/wp-...
0
votes
1answer
25 views

How to change text in a page by utilizing a custom user id?

I am looking for a way to change select text within the homepage on a particular site, utilizing a custom user id. I would like to be able to have multiple user id's for the same website without ...
0
votes
1answer
58 views

Editing existing pre-created menus in PHP

Here's my pickle. I'm using a script to automatically create a fully pledged WordPress site. In this process new pages, etc are created automatically. I now need a way to add the newly created page(s) ...
0
votes
1answer
31 views

Delete all blogs on multisite

I'm writing a function that will delete all blogs (except the main one) from a multisite, the function is dieing whenever I call wpmu_delete_blog and I've got no idea why. $blogs = wp_get_sites( ...