Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@JohnBunka
JohnBunka / functions.php
Last active Aug 29, 2015
Genesis - Display a custom favicon
View functions.php
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
function sp_favicon_filter( $favicon_url ) {
return 'http://www.mydomain.com/wp-content/images/favicon.ico';
}
@JohnBunka
JohnBunka / functions.php
Created May 29, 2015
Enable Genesis Accessibility
View functions.php
//* Add Accessibility support
add_theme_support( 'genesis-accessibility', array( 'headings', 'drop-down-menu', 'search-form', 'skip-links' ) );
@JohnBunka
JohnBunka / style.css
Created May 29, 2015
Enable Genesis 2.2 Accessibility CSS
View style.css
/* ## Screen reader text
--------------------------------------------- */
.screen-reader-text,
.screen-reader-text span,
.screen-reader-shortcut {
position: absolute !important;
clip: rect(0, 0, 0, 0);
height: 1px;
width: 1px;
@JohnBunka
JohnBunka / function.php
Created Jun 20, 2015
Genesis: Change the footer credits
View function.php
//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
$creds = '[footer_copyright] &middot; <a href="http://pressavenue.com">WordPress for Business</a> &middot; [footer_loginout]';
return $creds;
}
@JohnBunka
JohnBunka / functions.php
Created Jun 21, 2015
GenesisWP: Display a custom Favicon
View functions.php
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
function sp_favicon_filter( $favicon_url ) {
return 'http://www.pressavenue.com/wp-content/images/favicon.ico';
}
@JohnBunka
JohnBunka / functions.php
Created Jun 21, 2015
Genesis: Display a custom Gravatar
View functions.php
//* Display a custom Gravatar
add_filter( 'avatar_defaults', 'sp_gravatar' );
function sp_gravatar ($avatar) {
$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.png';
$avatar[$custom_avatar] = "Custom Gravatar";
return $avatar;
}
@JohnBunka
JohnBunka / functions.php
Last active Aug 27, 2015
How to use Font Awesome icons with Genesis in WordPress
View functions.php
//* Make Font Awesome available
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' );
function enqueue_font_awesome() {
wp_enqueue_style( 'font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.css' );
}
View font-awesome-example-larger-icons.html
<i class="fa fa-camera-retro fa-lg"></i> fa-lg
<i class="fa fa-camera-retro fa-2x"></i> fa-2x
<i class="fa fa-camera-retro fa-3x"></i> fa-3x
<i class="fa fa-camera-retro fa-4x"></i> fa-4x
<i class="fa fa-camera-retro fa-5x"></i> fa-5x
View font-awesome-example-fixed-width-icons.html
<div class="list-group">
<a class="list-group-item" href="#"><i class="fa fa-home fa-fw"></i>&nbsp; Home</a>
<a class="list-group-item" href="#"><i class="fa fa-book fa-fw"></i>&nbsp; Library</a>
<a class="list-group-item" href="#"><i class="fa fa-pencil fa-fw"></i>&nbsp; Applications</a>
<a class="list-group-item" href="#"><i class="fa fa-cog fa-fw"></i>&nbsp; Settings</a>
</div>