wf_head_meta » Hook no.2

Description

Use this hook to insert items into the <head> of your document. Similar to wp_head(), which runs AFTER wf_head_meta.

Example

In your child theme functions.php file:

<?php
function my_wfx_example_function() {
 echo '<meta name="generator" content="Mike and Ike Tropical Typhoon" />';
}
add_action ('wf_head_meta','my_wfx_example_function');
?>

Notes

Although you could hard-code the echo output function as shown in the example above to include extra scripts like CSS and Javascript, it is is not advised. Instead useĀ wp_register_style() and wp_enqueue_style() for CSS. For scripts like Javascript use wp_register_script() and wp_enqueue_script() – these are core WordPress functions which ensure dependencies are set properly. They also ensure things like Jquery are not included multiple times by accident or when you install well-written WordPress plugins.

This hook documentation was last modified on: August 13, 2011 by Jonny