wordpress head() code example
Example 1: do_action( 'wp_head' );
function hook_javascript() {
?>
<script>
alert('Page is loading...');
</script>
<?php
}
add_action('wp_head', 'hook_javascript');
Example 2: do_action( 'wp_head' );
function hook_css() {
?>
<style>
.wp_head_example {
background-color : #f1f1f1;
}
</style>
<?php
}
add_action('wp_head', 'hook_css');