There are functions for is_home()
, is_blog()
is_single()
etc…
What’s the best way to tell if I’m on a page that is requesting that I login? I guess that would just be the wp-login.php page.
1 Answer
Paste this function in your functions.php or a plugin file:
function is_login_page() {
return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
}
and then you can use it like this:
if(is_login_page()){
//this is a login page
}else{
//not the page you are looking for
}