Created
October 5, 2012 13:48
-
-
Save rs77/3839892 to your computer and use it in GitHub Desktop.
Favourite WordPress Functions to Customise WP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Load Google fonts (Genesis Studio Press theme) */ | |
add_action( 'wp_enqueue_scripts', 'minimum_load_google_fonts' ); | |
function minimum_load_google_fonts() { | |
wp_enqueue_style( | |
'google-fonts', | |
'http://fonts.googleapis.com/css?family=Lato:300,700', | |
array(), | |
PARENT_THEME_VERSION | |
); | |
} | |
/* changes the "Register For This Site" text on the Wordpress login screen (wp-login.php) */ | |
function ik_change_login_message($message) | |
{ | |
// change messages that contain 'Register' | |
if (strpos($message, 'Register') !== FALSE) { | |
$newMessage = 'Enter HTML text here!!'; | |
return '<p class="message register">' . $newMessage . '</p>'; | |
} | |
else { | |
return $message; | |
} | |
} | |
// add our new function to the login_message hook | |
add_action('login_message', 'ik_change_login_message'); | |
/** Customise the logo on login/registration page */ | |
function my_custom_login_logo() { | |
echo '<style type="text/css"> | |
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/custom-login-logo.gif) !important; } | |
</style>'; | |
} | |
add_action('login_head', 'my_custom_login_logo'); | |
// link details of image go in here... | |
function put_my_url(){ | |
return ('http://www.mydomain.com/'); | |
} | |
add_filter('login_headerurl', 'put_my_url'); | |
/** Remove the login/registration page on password text */ | |
function remove_password_email_text ( $text ) { | |
if(basename($_SERVER["SCRIPT_NAME"])=='wp-login.php' && $text == 'A password will be e-mailed to you.'){ | |
$text = ''; | |
} | |
return $text; | |
} | |
add_filter( 'gettext', 'remove_password_email_text' ); | |
/** Customize the credits for Genesis Studio Press themes */ | |
add_filter('genesis_footer_creds_text', 'custom_footer_creds_text'); | |
function custom_footer_creds_text() { | |
$creds = '<div class="creds"><p>'; | |
$creds .= 'Copyright © '; | |
$creds .= date('Y'); | |
$creds .= ' · <a href="http://currencysecrets.com">Currency Secrets.com</a>'; | |
$creds .= '</p></div>'; | |
return $creds; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment