Articles of scripts

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/main.js’, null, null); } add_action(‘wp_enqueue_scripts’, ‘banana_scripts’); I have the above hook in my functions.php. The first js file gets included, the second not. Is it incorrect to call this function twice or more?

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, $GLOBALS[‘wpdb’]->get_row, etcetera. Url for testing will be: www.mydomain.coml/wp-admin/script.php Is there a minimum of files to include so I can […]

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=”″> </SCRIPT> <NOSCRIPT><A rel=”nofollow” HREF=””> Widgets</A></NOSCRIPT> EDIT: The reason why the widget doesn’t appear after embeded the above code into HTML is that the widget is blocked by AdBlock.

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</description> <category>Category-1<category> <merchant>1234</merchant> <price>12</price> <instock>1<instock> <stockstatus>45</stockstatus> <image></image> <manufacture>987</manufacture> </product> I need to write a script that will add these detail as a product. For now I am not using any WP plugin for eCommerce […]

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 pages can change drastically from one day to the next. I am trying to create regular backups to a remote server that will run […]

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: <body> /* do something */ <script type=”text/javascript” id=”widget-code”> /* widget pops up */ </script> <\body> What I want to do […]

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 said Custom Admin Page, I have an ‘Upload Profile Image’ button. The button works fine, in the respect […]

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 add_action( ‘wp_enqueue_scripts’, ‘custom_theme_load_scripts’ ); function custom_theme_load_scripts() { wp_enqueue_script( ‘jquery’ ); } And what I’m trying to do in […]

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 javascript file, it doesn’t seem to enqueue past the original two scripts at all, as if it is completely ignoring my […]

Display a consistent Google Plus icon on ALL pages of my site

My website is and I have managed to setup the Google Plus script. The issue is that every page of the site displays a different Google Plus count. For example, if you go on my site you will see that I have about 180 Google Pluses. Now, if you click on something like “Tablified […]