Skip to content

Instantly share code, notes, and snippets.

@mjsdiaz
Created February 3, 2014 23:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjsdiaz/8794926 to your computer and use it in GitHub Desktop.
Save mjsdiaz/8794926 to your computer and use it in GitHub Desktop.
Use WordPress Dashicons to Add Font Icons to Your Genesis Theme -- http://amethystwebsitedesign.com/use-wordpress-dashicons-to-add-font-icons-to-your-genesis-theme/
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_dashicons' );
function amethyst_enqueue_dashicons() {
wp_enqueue_style( 'amethyst-dashicons-style', get_stylesheet_directory_uri(), array('dashicons'), '1.0' );
}
// Optional Custom entry meta in entry header - remove "by""
add_filter( 'genesis_post_info', 'amethyst_filter_post_info' );
function amethyst_filter_post_info($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
// Optional Custom post meta in entry footer - remove text
add_filter( 'genesis_post_meta', 'amethyst_filter_post_meta' );
function amethyst_filter_post_meta($post_meta) {
$post_meta = '[post_categories before=""] [post_tags before=""]';
return $post_meta;
}
.entry-time:before,
.entry-author:before,
.entry-comments-link:before,
.entry-categories:before,
.entry-tags:before {
color: #f15123;
display: inline-block;
-webkit-font-smoothing: antialiased;
font: normal 20px/1 'dashicons';
vertical-align: top;
margin-right: 5px;
margin-right: 0.5rem;
}
.entry-time:before {
content: "\f145"; /* dashicons-calendar */
}
.entry-author:before {
content: "\f110"; /* dashicons-admin-users */
}
.entry-comments-link:before {
content: "\f101"; /* dashicons-admin-comments */
}
.entry-categories:before {
content: "\f318"; /* dashicons-category */
}
.entry-tags:before {
content: "\f323"; /* dashicons-tag */
}
.entry-time,
.entry-author,
.entry-categories {
padding-right: 15px;
padding-right: 1.5rem;
}
/* Optional */
.entry-categories,
.entry-tags {
display: inline-block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment