Skip to content

Instantly share code, notes, and snippets.

View rickrduncan's full-sized avatar

Rick R. Duncan rickrduncan

View GitHub Profile
@rickrduncan
rickrduncan / header-image.php
Created July 3, 2013 14:45
Filter the genesis_seo_title function to use an image for the logo instead of a background image.
<?php
//* Do NOT include the opening php tag
// Filter the genesis_seo_title function to use an image for the logo instead of a background image
add_filter( 'genesis_seo_title', 'b3m_header_title', 10, 3 );
function b3m_header_title( $title, $inside, $wrap ) {
$inside = sprintf( '<a href="%s" title="%s"><img src="'. get_stylesheet_directory_uri() .'/images/logo.png" alt="%s" /></a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) );
return sprintf( '<%1$s id="title">%2$s</%1$s>', 'h4', $inside );
}
@rickrduncan
rickrduncan / style.css
Created July 3, 2013 14:47
Remove smiley place added into your footer by the WordPress JetPack plugin
/* Remove smiley place added to your footer by the WordPress JetPack plugin */
img#wpstats {
display: none;
}
@rickrduncan
rickrduncan / 404.php
Created July 5, 2013 14:46
404 page temple for the Genesis Framework. Includes a test for the Yoast SEO plugin in order to alter the page title.
<?php
/*
Template Name: Error 404
*/
/**
* Handles the display of website 404 page. Includes a widget area for easy customization.
*
* @author B3Marketing, LLC — Rick R. Duncan
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
<?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
//-> Login Screen: Change login logo hover text
add_filter( 'login_headertitle', 'rvam_login_logo_url_title' );
function rvam_custom_header_title() {
return 'REPLACE THIS WITH YOUR TEXT';
}
<?php
//-> Do NOT include the opening php tag
// Login Screen: Set 'remember me' to be checked
add_action( 'init', 'rvam_login_checked_remember_me' );
function rvam_login_checked_remember_me() {
add_filter( 'login_footer', 'rvam_rememberme_checked' );
}
function rvam_rememberme_checked() {
<?php
//-> Do NOT include the opening php tag
// Login Screen: Don't inform user which piece of credential was incorrect
add_filter ( 'login_errors', 'rvam_failed_login' );
function rvam_failed_login () {
return 'The login information you have entered is incorrect. Please try again.';
}
<?php
//-> Do NOT include the opening php tag
// Custom admin dashboard header logo
add_action('admin_head', 'rvam_custom_admin_logo');
function rvam_custom_admin_logo() {
echo '<style type="text/css">#icon-index { background-image: url('.get_stylesheet_directory_uri().'/images/logo-dashboard.png) !important; background-position: 0 0;}</style>';
}
@rickrduncan
rickrduncan / admin-footer-text.php
Created July 20, 2013 11:48
Place the Php code into your theme's functions.php file to customize the admin footer text in WordPress.
<?php
//-> Do NOT include the opening php tag
// Add theme info box into WordPress Dashboard
add_action('wp_dashboard_setup', 'rvam_add_dashboard_widgets' );
function rvam_add_dashboard_widgets() {
wp_add_dashboard_widget('wp_dashboard_widget', 'Theme Details', 'rvam_theme_info');
}
function rvam_theme_info() {