• Hi, for action hooks, is the idea that we register an action BEFORE defining our function, and we have to put the action in our pages where we want it to be called?

    So eg:
    add_action(‘wp_head’, ‘myFunction’);/*register our action hook*/

    function myFunction()
    {
    /*etc*/
    }

    then in my index.php

    <?php wp_head; ?>

    Am I correct, let me know.

    Appreciate all the help.

Viewing 1 replies (of 1 total)
  • It does not matter whether the add_action call is before or after the function definition as long as the function is compiled before the add_action call.

    The call to wp_head() is made inside the <head> . . . </head> section, usually in header.php. See this Codex article.

Viewing 1 replies (of 1 total)

The topic ‘Regarding action hooks’ is closed to new replies.