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

The tag has no usage guidance.

0
votes
1answer
22 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
17 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
23 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
65 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
16 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
21 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
7 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
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
61 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
36 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
56 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
70 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
74 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
32 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
30 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
79 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
17 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
745 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
357 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
200 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
108 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
216 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
45 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
354 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
360 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
651 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
33 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
66 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
36 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
679 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
190 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
425 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
46 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
229 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
46 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
115 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
103 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 ...