Hooks

How they work

Can create for front end and back end

Only work because of two functions that compete each other:

do_action()
add_action()

do_action() sets an action hook anywhere in the WordPress code.

add_action – helps you hook the the code.

So do_action() is the point in the code that the hook is available and add_action() is where you will hook your functions.

add_action(hook_name, called_function_name);

Usually put right after your function.

function add_div_tag_before(){
?>    Loop has started
<?php
add_action('loop_start','add_div_tag_before');

This returns no value.

Can add a priority value to it as well.