The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
0answers
11 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
27 views

All HTML code appears in body tag [on hold]

I have external admin area script i want to use wp functions in it so i include wp-load file top of script's functions file. My problem is all of html code of script is in body tag. It is like ...
0
votes
0answers
27 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
27 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: ...
0
votes
1answer
22 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
38 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
35 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
16 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
29 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
86 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
48 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
89 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
42 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" ...
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
62 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
31 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 ...
0
votes
1answer
30 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
58 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
94 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
55 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
25 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
68 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
250 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
41 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() . ...
0
votes
0answers
18 views

Export huge sites

I né ed to export data from a comple of sites that contain a lot of posts (tens of thousands). When I try to export all, the procedure fails, I get a partial WXR, so I have to export individual custom ...
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
100 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
0answers
79 views

I would like to auto-install Wordpress on sub-domain

I am offering WordPress only hosting. I am using WHM/WHMCS automatically create a sub-domain and cpanel account for new clients after they place an order. I would like to automatically install ...
0
votes
1answer
205 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
175 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
15 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 ...
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
47 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 ...
0
votes
1answer
71 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
66 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 ...
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
52 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
326 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
239 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
326 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
488 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
50 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 ...