views:

196

answers:

1

I want my scripts and css files to be added in the footer and header respectively, ideally they should be minimized and compressed too, I think these functions can help but iI am not aware of using them. can anybody help me with these ?

wp_print_scripts, wp_enque_scripts, wp_head, wp_register_script

A: 

All info all you need is in http://codex.wordpress.org/, examples, use cases and more :-)

lfx
there is no documenteion or examples for these functions there :(
Umair
I looked deeper and found that all functions above goes throw one `wp_enqueue_script` function -> http://codex.wordpress.org/Function_Reference/wp_enqueue_script
lfx
I have my own custom theme, I want my css files to be loaded in the head section of HTML, right now as I call my plugins they add their css files right there in the HTML where they are called, i Want such a hook that integrates those css calls in the HEAD tag.
Umair
Then use `<link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_url'); ?>" />` this directs to `http://example/home/wp/wp-content/themes/yourTheme/style.css`. It's best way to do your task :) Moreover if you need add more style.css you could include those in primary style.css with `@import url("style.css");`
lfx
this is a good way, but in my case style sheets are loaded dynamically by the plugins and widgets
Umair
There is blatantly documentation on the codex: the first hit for wp_head is the page you want: http://codex.wordpress.org/Plugin_API/Action_Reference/wp_headThere are tutorials on there as well, and you can download any plugin that has style sheets if you need more examples to follow.
Nicholas Wilson