There is a better way than using global variable $pagenow
to detect current page if is login page, like a is_admin()
?
if ($pagenow !=
While I tend to agree with others on the need for a function is_login_page() or something similar, I found what seems to be the best answer at https://wordpress.stackexchange.com/questions/12863/check-if-were-on-the-wp-login-page, which I used to make the following:
<?php
function is_login_page() {
return in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'));
}
Incase you want to be as non WP independant as possible; for instance in a plugin keeping future changes out of scope. You can use something like this:
function is_login_page() {
return !strncmp($_SERVER['REQUEST_URI'], '/wp-login.php', strlen('/wp-login.php'));
}
Can't you explain what are you going to do with it? So I can tell if you should code using wordpress hooks.
or you can use the absolute uri, just match it with wp-login.php
<?php
$uri = $_SERVER['REQUEST_URI'];
echo $uri;
?>
If you are like me, and you actually tried to de-register / mess with the jQuery that WordPress automatically loads, then the correct answer is:
Don't use wp_print_styles
to register your scripts – use wp_enqueue_scripts instead!
This hook will run only on the frontend, not on the login page, so there's no need for workarounds.
Nacin is explaining it here: http://make.wordpress.org/core/2011/12/12/use-wp_enqueue_scripts-not-wp_print_styles-to-enqueue-scripts-and-styles-for-the-frontend/