How to run a function in every page, every device

Generally functions hooked with init action will be available on every page and posts with in WordPress. it will immediately fire upon WP load. so maybe something like below will work.

function ao_check_cookie() {
 //Your code here.
}
add_action( 'init', 'ao_check_cookie' );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)