Question: Hi i am new to wordpress , I am trying to validate a value. So each time the page loads the function must execute, is it possible to write it in my functions.php?

```
function checknewusr()
{
   //My Code;
}
add_action('????', 'checknewusr');

```

I am not aware of the action hook to give on that area so that my function will execute every time i load a page.

Answer: 
`add_action()` adds a function when a certain situation occurs, 

`add_action('init','checknewusr');` should do it.

There is quite an extensive array of actions, each targeting certain functions. It would probably be better to call `add_action()` on the most appropriate scenario rather than the `init` hook but this will work in most situations.

**Reading Material:**

[Codex - Add Action](http://codex.wordpress.org/Function_Reference/add_action)

[Codex - Plugin API/Action Reference](http://codex.wordpress.org/Plugin_API/Action_Reference)
Use like this in functions.php:

```
function checknewusr()
{
   //My Code;
}    
if ( ! is_admin() ) {
     checknewusr();
}

```

This will execute every time any page loads in frontend.