The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
0answers
17 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
0answers
28 views

Tracing which wordpress php script executes specific actions

Is there any way to trace which php script in wordpress executes a specific actions ? In my case I want to trace which php file in wordpress whether a plugin script , theme script or standard ...
0
votes
1answer
29 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
23 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 ...
12
votes
3answers
1k views

Conditionally enqueue a widget's script/stylesheet in HEAD (only when present on page!)

I've been trying to load scripts and styles for a WordPress widget with the following conditions... The scripts MUST load in the HEAD (else they break). The scripts must ONLY load when the widget ...
0
votes
1answer
39 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
0answers
41 views

How to unwrap/separate Html tags in pages?

I have around 300 pages with some of them having wrong HTML formatting that I have to fix. I want to: Separate the H1 tag from the inner tags. Moving the TITLE (found in span) to H1. Get rid of the ...
0
votes
1answer
19 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( ...
8
votes
4answers
2k views

How can I create a bash install script for my Wordpress sites setup (WP+plugins+theme)?

I build a lot of websites with Wordpress, and my initial setup is basically always the same : Latest version of WP Latest versions of about 5 plugins My naked development theme Instead of ...
0
votes
1answer
36 views

Correct usage of scripts with shortcodes

I'm not sure I correctly "insert" scripts in my pages. Concrete example: I need to generate a map with the google API, and decided to write a plugin to do that. Question now is what is the correct ...
1
vote
1answer
103 views

wp_enqueue_script with dependencies doesn't work

I'm having this code: wp_register_script('parent','parent.js', array('child'), '1', true); wp_register_script('child', 'child.js', array('grandchild'), '1', true); wp_register_script('grandchild', '...
1
vote
2answers
50 views

How do I load custom scripts and styles for a page?

Different pages often need different set of scripts and styles for them. I use functions.php and construction like this to load scripts and styles: function load_assets() { wp_enqueue_style( '...
0
votes
2answers
93 views

WP CLI theme install. Install a private repo?

I have a bash script that installs and activates a theme like this: wp theme install https://bitbucket.org/organization/theme/get/master.zip --activate The problem is that it only works with public ...
0
votes
1answer
50 views

How do I insert an amazon search widget into posts or pages?

How do I insert an Amazon Search Widget into posts or pages? The source code is: <SCRIPT charset="utf-8" type="text/javascript" src="http://ws-cn.amazon-adsystem.com/widgets/q?rt=tf_sw&...
0
votes
1answer
24 views

What do I need for testing a single script in admin

I like to test a single script in the wp-admin area. Do not know what to include at the top of my script.php file for testing including all kind if DB access + Wordpress like $wpdb->get_results, $...
0
votes
0answers
13 views

Correct way to update wp_script() url/src? [duplicate]

I tried to update the url/src of the queued $wp_scripts correctly... my aim is to use just relative paths. Therefore I: loaded the $wp_scripts replace the domain and saved the output. But it seems ...
0
votes
1answer
93 views

Best way to create a user programatically

I want to create a user via a standalone script. I want an activation email to be sent out, in the same way that it is when a user is created from the Add User screen. An email is set out with a link ...
0
votes
2answers
27 views

I can't enqueue my scripts - They literally aren't being added to my site

Ok, I've literally copy-pasted different enqueueing code from about 5 different sources (Including wordpress), and not a single one works. Here's the code I'm using in functions.php: <?php ...
0
votes
1answer
34 views

Deregister script on specific user's BuddyPress page

I run a BuddyPress website and I need to deregister a script on a specific BuddyPress profile page (change avatar to be more specific) To achieve this I try this code add_action('wp_enqueue_scripts',...
0
votes
1answer
32 views

Scripts not loading when using the wp_enqueue_scripts action

Really basic, I'm afraid. My scripts aren't loading when I put them as part of a function triggered by the wp_enqueue_scripts action in functions.php. If I put them outside of that action as part of ...
0
votes
1answer
59 views

JQuery Login Dropdown not functioning in theme

Having a problem on my demo site (http://somm.icorp.net/) what I'm attempting to accomplish is when you click on the LOGIN button a drop down appears and using JQuery, it displays a login box so users ...
1
vote
0answers
97 views

Trigger a php file on every post or page if a condition is met

I was wondering if we can trigger a PHP file on every WordPress post or page if a certain condition is met. Let me detail what I want. Can we write a simple PHP script that will be automatically ...
0
votes
0answers
57 views

Safari only bug: script enqueuing blocks other scripts

Looking for some advice. One page of my blog is an angular app that is loaded via systemjs. It loads fine in Chrome (and firefox) on my computers and Android phone. But Safari is very erratic and ...
0
votes
0answers
26 views

How to list the scripts and styles enqueued for a certain page?

How do I get all the scripts and styles used on a certain WordPress page. I would like to see the following, Name of script/style URL to script/style Version of script/style And if a certain script ...
0
votes
1answer
77 views

Domain mapping breaks some plugin scripts and css

Here is the context: I have a sub domains wp mu install with wp-content in a different location and using the domain mapping plugin. WP and all my plugins are up to date. There is no https involved. ...
0
votes
0answers
252 views

wordpress video sharing clone script?

Is there any wordpress video sharing clone script like youtube? i have seen many, but they only allow the admin to upload videos, i want a script where users can register and upload their videos other ...
0
votes
1answer
43 views

wp_enqueue_script adds only the first script

function banana_scripts() { wp_enqueue_script('grid', get_stylesheet_directory_uri() . '/js/jquery.min.js', null, null); wp_enqueue_script('grid', get_stylesheet_directory_uri() . '/js/...
0
votes
1answer
29 views

Dequeue set-post-thumbnail.min.js

Want to alter the behavior how set-post-thumbnail works (add additional functionality upon successful set post thumbnail). Looking on how to dequeue the stock set-post-thumbnail.min.js script so I can ...
0
votes
1answer
104 views

Run one-time script calling plugin functions

I want to add a product programmatically using a wordpress plugin but programmatically as entering it manually is a hassle. I have a little bit of programming experience. I found this: What is your ...
0
votes
1answer
2k views

How to properly dequeue scripts and styles in child theme?

I made a parent theme and a child theme in one of my project. I enqueued CSS and JavaScripts in my parent theme like below: function project_necessary_scripts() { //Stylesheets ...
0
votes
1answer
215 views

jQuery functions work in console, but not live

I am trying to traverse the DOM in a number of places, replacing some of the content. jQuery('.homepage_buttons_text a[href^="http://danrobertsgroup.com/?attachment_id=1037"]').each(function(){ ...
0
votes
1answer
176 views

Call/Run a Mathematica (.m) Shell Script from Wordpress Page/Blog

Is it possible to run a Mathematica shell script from a Wordpress page or blog post? There doesn't seem to be a plugin available or way to do this. The script would need to take values inputted in ...
0
votes
1answer
16 views

WordPress menus - automatically generate

I want to automatically generate some menu items using a script (i.e. using wp_update_nav_menu_item). This would usually be a one-off event but I might want to repeat it if the menu items need re-...
1
vote
2answers
1k views

Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import - How?

Some way to Flush or Overwrite all Imported Content in a Site for a Fresh Import - How? Is there an easy quick way to do this? To delete all Pages, Posts, Comments and stuff that got imported? Or ...
0
votes
0answers
49 views

Echo outside HTML

I'm new to Wordpress and I want to echo a script and a css file inside the footer.php . This is the code that I use. echo "<script src='file.js'></script>"; echo '<link rel="stylesheet"...
0
votes
1answer
75 views

Disable load scripts and styles not working

I'm trying to disable the load of nextgen gallery 2.x styles and scripts, I used function mytheme_deregister_scripts_and_styles(){ $unwanted_scripts = array( 'photocrati_ajax' ); foreach (...
0
votes
0answers
67 views

custom script not loading at admin pages

I want to load a custom script on the admin pages. Seems simple right. Still, for some reason the script is not loading. I've tried putting this in my themes functions: add_action( '...
0
votes
1answer
43 views

Generating a static page from a script

I use a script to generate the ranking page http://joereddington.com/ranking.html from a script. Here's a relevant bit of the script: cat $DIR/start.html > $DESTINATION_PAGE grep -o "<img.*...
20
votes
8answers
3k views

What is your best practice to execute one-time scripts?

The Problem We all have been in a situation like this, and a lot of questions on this site need a solution like this. You either have to update a database, insert a lot of data automatically, convert ...
0
votes
1answer
28 views

Plugin's required JS not being inserted in my theme

All my plugins and their necessary .js files aren't being inserted in my theme's head. The CSS files are being inserted ok, but not the .js files. Not sure what's wrong. When I switch to a default ...
3
votes
2answers
1k views

Get list of scripts / styles and show file which enqueued them

I want to show what scripts and styles have loaded on a page and which plugin / theme / file has added them to the page. We can show all scripts and styles using: <?php global $wp_scripts, $...
0
votes
2answers
54 views

Register Script in Plugin Widget

I need to load a separate js file into a widget and just can't get it to work. So far I have if ( is_active_widget( false, false, $this->id_base, true ) ) { function tab_widget_scripts() { ...
0
votes
0answers
340 views

Manipulate database of WordPress site with my own scripts

I love WordPress as it provides plenty of great themes, good SEO and overall content management. But I'm not always happy with WordPress's original "Add post" and "Edit post" features as it required ...
0
votes
0answers
257 views

Wordpress GZip, Concatenation, Compression

I appreciate that I can define each of the following in wp-config.php and that each has its own merits, but is there any sense in defining all to work together? Compress CSS Compress Scripts ...
0
votes
1answer
335 views

Add class to comment form div when comment-reply button is clicked

I'm using the comment-reply script to move the comment form under thread when replying to a specific comment. Comment form is being displayed in theme with: <?php comment_form(); ?> The ...
1
vote
1answer
515 views

Overwrite or Replace code in WP_Footer

I have a some code being dynamically added into my Footer via add_action('wp_footer' ...). Unfortunately I'm not sure how to remove it using conventional methods, I've looked at the following question ...
0
votes
1answer
52 views

How to deregister scripts all at once

How can I deregister all wordpress scripts all at once except for the admin? I have looked at the discussion How can I de-register ALL styles all at once? And same with Javascript?, but i do not want ...
0
votes
1answer
129 views

change $src from wp_register_script in plugins/themes

I have a lot of plugins using external scripts from googleapis - these are throttled/blocked in China and it causes a lot of problems. Without rewriting the lines in all the plugins/themes and break ...
0
votes
3answers
1k views

How do I enqueue a JavaScript in my footer via the functions.php file?

Okay, so I'm well familiar with the way to properly enqueue a stylesheet or JavaScript in the WordPress header via the functions.php file. Recently though I came across a situation that has me ...
0
votes
0answers
262 views

How do I display the handle for all front-end enqueued scripts in plugin options page?

I use the following function in my plugin to display all the scripts handles in my plugin options page but it display only the handles of admin scripts: function my_detected_scripts() { global $...