Linked Questions

3
votes
1answer
3k views

Which action to hook wp_enqueue_script to? wp_head or wp_enqueue_scripts? [duplicate]

Possible Duplicate: Where is the right place to register/enqueue scripts & styles According to wp_enqueue_script() documentation in Codex, it seems that one should hook wp_enqueue_script() ...
1
vote
1answer
3k views

wp_enqueue_style in Plugin [duplicate]

Possible Duplicate: Where is the right place to register/enqueue scripts & styles When I enqueue a css style in a plugin like so: function add_my_stylesheet() { wp_enqueue_style( '...
0
votes
1answer
3k views

Add multiple JavaScript files to template header [duplicate]

I have multiple JavaScript files that I want to load. Some of them in my header.php and the rest in the footer.php. These are the files: <?php <script type="text/javascript src="/scripts/...
1
vote
0answers
26 views

How to enqueue script or style in a theme's template file? [duplicate]

I am making a template for the page which will contain a slider. Can anyone share some advice with me of how to go about it?
1
vote
2answers
13k views

Enqueue jQuery in WordPress

Building my first theme from scratch in Wordpress 3.4.1, I know Wordpress already has the latest version of the JQuery via Google. I have read about issue's if the script is not called properly, so ...
4
votes
4answers
841 views

Why are admin scripts not printed

I am trying to enqueue/print scripts in the admin area. But they dont seem to appear. add_action('admin_init', function() { add_meta_box('portfolio-meta', 'Details', 'portfolio_metabox_details', '...
4
votes
2answers
2k views

jQuery in header or footer

From my reading it seems there is a good case for loading scripts like jquery and dependencies into the footer as a preference if possible; however 2 things confuse me which. Firstly the default for ...
4
votes
1answer
2k views

How can we customize the logo and some text on the welcome screen?

I have found discussions and solutions on hiding or removing the lately introduced Welcome screen. But we DO find the screen, as a whole, very useful and an excellent addition. So, what we are ...
4
votes
1answer
2k views

Using Underscore Templates in WordPress

I've noticed that since WP 3.5 that we now have the Backbone.js and Underscore.js libraries included. The new Media Modal uses Underscore templates and I was wondering how would I be able to insert ...
2
votes
2answers
3k views

Where to enqueue stylesheets for plugin?

I want to enqueue stylesheet to plugin I'm developing, like this: function utm_user_scripts() { $plugin_url = plugin_dir_url( __FILE__ ); wp_enqueue_style( 'style', $plugin_url . "/css/style....
1
vote
1answer
2k views

Enqueue jQuery UI Tabs In Admin Area

Does anyone know how to enqueue the script "Jquery UI Tabs" in admin area? I want to use it inside my theme options page. Already read the related wordpress documentation but with no results... I have ...
2
votes
2answers
256 views

WordPress classes explained

Are there any books, websites or lectures that explain the built-in WordPress classes? I would really like to learn how WordPress works internally. I've dug up the core files on trac and even went ...
3
votes
1answer
1k views

Enqueue scripts inside a class

I have written a small class that will handle enqueues in my theme : <?php class Header { public function init_hooks() { add_action('wp_print_scripts', array(__CLASS__,'...
0
votes
2answers
631 views

Can't get CSS Into the Head via add_action

I'm trying to add some CSS to the head part of the CSS but I can't get it to work (I want to add it to the head before the Theme CSS so the plugin user can easily over-ride plugins default CSS without ...
1
vote
1answer
1k views

How to add parameter to wp_enqueue_script?

I have the situation that I need to include special scripts only in case a parameter in a macro is used. For the background, see the following: My plugin ChessTempoViewer which wraps a JavaScript ...
0
votes
2answers
997 views

Dequeue, Unregister, Remove Action - Not Working on Plugin

Several years ago, not really having a handle on the best practice for running a MultiSite network, I often network activated plugins. Later I realized this was a mistake because not all the sites ...
0
votes
1answer
900 views

enqueue script if page is not equal to

I'm registering some js scripts in my function.php, I have 2 versions of one js file, one FOR the homepage, and one for every other page. I've managed to get this to work to register the homepage ...
0
votes
1answer
608 views

Jquery Theme Roller to Wordpress

How can you load a custom made Roller Theme for Jquery ui to wordpress? I recently created and downloaded a new theme for the datepicker, but can't get it loaded. I tried adding the css file to my ...
0
votes
2answers
171 views

JavaScript enque stopped working

Somewhere along the line I have messed up my js enqueue I am not sure how. I have the following in my functions.php file and I am including <?php wp_footer(); ?> in my footer.php before the js ...
0
votes
2answers
430 views

When to use add_action when registering/enqueuing scripts

When should you use add_action to enqueue or register a script, vs just using wp_register_script and/or wp_enqueue_script? In other words, both example 1 and example 2 below seem to accomplish the ...
1
vote
1answer
204 views

Blip Slideshow plugin Mootools/jQuery conflict

This particular site uses the Blip Slideshow plug in (because it's fed by a Picasa web rss feed) and also a jQuery powered slider. The plug in inserts the Mootools script links ahead of the jQuery ...
0
votes
1answer
115 views

Add custom class to a tags [closed]

I want to create a plugin that adds specific class to all a tags.
0
votes
0answers
103 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
2answers
63 views

JS script not being included [closed]

I am trying to enqueue a js file in functions.php but its not working. Following is my code add_action('init','shopswing'); function shopswing(){ if(!is_admin()){ wp_register_script('...