Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
<?php
//* Do NOT include the opening php tag
//* Enqueue Dashicons
add_action( 'wp_enqueue_scripts', 'b3m_enqueue_dashicons' );
function b3m_enqueue_dashicons() {
wp_enqueue_style( 'dashicons' );
}
<?php
//* Do NOT include the opening php tag
//* Login Screen: Use your own URL for login logo link
add_filter( 'login_headerurl', 'b3m_url_login' );
function b3m_url_login(){
return get_bloginfo( 'wpurl' ); //This line keeps the link on current website instead of WordPress.org
}
<?php
//* Do NOT include the opening php tag
//* Add theme info box into WordPress Dashboard
add_action('wp_dashboard_setup', 'b3m_add_dashboard_widgets' );
function b3m_add_dashboard_widgets() {
wp_add_dashboard_widget('wp_dashboard_widget', 'Theme Details', 'b3m_theme_info');
}
<?php
//* Do NOT include the opening php tag
//* Login Screen: Don't inform user which piece of credential was incorrect
add_filter ( 'login_errors', 'b3m_failed_login' );
function b3m_failed_login () {
return 'The login information you have entered is incorrect. Please try again.';
}
<?php
//* Do NOT include the opening php tag
//* Login Screen: Set 'remember me' to be checked
add_action( 'init', 'b3m_login_checked_remember_me' );
function b3m_login_checked_remember_me() {
add_filter( 'login_footer', 'b3m_rememberme_checked' )
;
}
<?php
//* Do NOT include the opening php tag
//* Login Screen: Change login logo hover text
add_filter( 'login_headertitle', 'b3m_login_logo_url_title' );
function b3m_login_logo_url_title() {
return 'REPLACE THIS WITH YOUR TEXT';
}
<?php
//* Do NOT include the opening php tag
//* Login Screen: Change login logo
add_action( 'login_head', 'b3m_custom_login_logo' );
function b3m_custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image:url('.get_stylesheet_directory_uri().'/images/login.png) !important; background-size: 311px 100px !important;height: 100px !important; width: 311px !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
.login form { margin-top: 10px !important; }
</style>';
<?php
//* Do NOT include the opening php tag
//* Default arguments from the Genesis Breadcrumb
//* genesis/lib/classes/breadcrumb.php
public function __construct() {
//* Default arguments
$this->args = array(
'home' => __( 'Home', 'genesis' ),
'sep' => __( ' <span aria-label="breadcrumb separator">/</span> ', 'genesis' ),
'list_sep' => ', ',
<?php
//* Do NOT include the opening php tag
//* STEP 1
//* Enqueue styles
add_action( 'wp_enqueue_scripts', 'b3m_enqueue_styles' );
function b3m_enqueue_styles() {
wp_enqueue_style( 'fa', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), '4.5.0' );
}