This file contains hidden or 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
/** | |
* Change login logo | |
* Max image width should be 320px | |
* @link http://andrew.hedges.name/experiments/aspect_ratio/ | |
*/ | |
add_action('login_head', 'rgt_custom_dashboard_logo'); | |
function rgt_custom_dashboard_logo() { | |
echo '<style type="text/css"> | |
.login h1 a { | |
background-image:url('.get_stylesheet_directory_uri().'/images/logo.png) !important; |
This file contains hidden or 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
<?php | |
// Add new image size | |
add_image_size( 'portfolio-thumbnail', 264, 149, TRUE ); | |
// Add new image size | |
add_image_size( 'one-third', 375, 250, TRUE ); |
This file contains hidden or 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
//* Replace the standard loop with our custom loop | |
//* props to David Wang, he is the man! | |
// @author David Wang | |
// @link http://genesissnippets.com/genesis-custom-loop/ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'child_do_sticky_post', 5 ); | |
function child_do_sticky_post() { | |
This file contains hidden or 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
// Remove Image Alignment from Featured Image | |
// @link http://www.billerickson.net/genesis-featured-image-alignment/ | |
add_filter( 'genesis_attr_entry-image', 'be_remove_image_alignment' ); | |
function be_remove_image_alignment( $attributes ) { | |
$attributes['class'] = str_replace( 'alignleft', 'alignnone', $attributes['class'] ); | |
return $attributes; | |
} |
This file contains hidden or 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
//* Remove the post content (requires HTML5 theme support) | |
remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); |
This file contains hidden or 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
//* Force content-sidebar layout setting | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); | |
//* Force sidebar-content layout setting | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' ); | |
//* Force content-sidebar-sidebar layout setting | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar_sidebar' ); | |
//* Force sidebar-sidebar-content layout setting |
This file contains hidden or 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
//* Remove the loop | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); |
This file contains hidden or 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
// Redirect admins to the dashboard and other users elsewhere | |
// @link http://www.remicorson.com/tip-redirect-a-wordpress-user-after-login/ | |
add_filter( 'login_redirect', 'xxx_login_redirect', 10, 3 ); | |
function xxx_login_redirect( $redirect_to, $request, $user ) { | |
// Is there a user? | |
if ( is_array( $user->roles ) ) { | |
// Is it an administrator? | |
if ( in_array( 'administrator', $user->roles ) ) | |
return home_url( '/wp-admin/' ); |