Skip to content

Instantly share code, notes, and snippets.

View JohnBunka's full-sized avatar
🎯
Focusing

John Bunka JohnBunka

🎯
Focusing
View GitHub Profile
@JohnBunka
JohnBunka / functions.php
Last active August 29, 2015 14:21
Genesis - Display a custom favicon
//* 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 16:34
Enable Genesis Accessibility
//* 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 16:37
Enable Genesis 2.2 Accessibility 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 June 20, 2015 19:40
Genesis: Change the footer credits
//* 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 June 21, 2015 01:58
GenesisWP: Display a custom Favicon
//* 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 June 21, 2015 02:25
Genesis: Display a custom Gravatar
//* 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 August 27, 2015 20:58
How to use Font Awesome icons with Genesis in WordPress
//* 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' );
}
<i class="fa fa-camera-retro"></i> fa-camera-retro
<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
<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>