Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Last active August 29, 2015 14:04
Add Dashicons Icon to Genesis Framework Meta
<?php //* Please don't copy this opening php tag
//* Enqueue Dashicons Scripts
add_action( 'wp_enqueue_scripts', 'afn_add_dashicons' );
function afn_add_dashicons() {
wp_enqueue_style( 'dashicons' );
}
//* Customize the entry meta in the entry header (requires HTML5 theme support)
add_filter( 'genesis_post_info', 'afn_custom_header_meta' );
@wpspeak
wpspeak / functions.php
Last active August 29, 2015 14:02
Enqueue Octicons icon font in WordPress
<?php
//* Enqueue Octicons icon font in WordPress
add_action( 'wp_enqueue_scripts', 'afn_enqueue_octicons' );
function afn_enqueue_octicons() {
wp_enqueue_style( 'afn-octicons', get_bloginfo( 'stylesheet_directory' ) . '/octicons/octicons.css', array(), '2.0.2' );
}
@wpspeak
wpspeak / functions.php
Created May 25, 2014 22:26
Add oEmbed support for CodePen
<?php
//* Add oEmbed support for CodePen
wp_oembed_add_provider('http://codepen.io/*/pen/*', 'http://codepen.io/api/oembed');
@wpspeak
wpspeak / functions.php
Created May 17, 2014 15:54
Rebuild Genesis Footer Credit with Nofollow Attribute on Links
<?php
//* Rebuild Genesis Footer Credit with Nofollow Attribute
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'afn_custom_footer' );
function afn_custom_footer() {
?>
<p>&copy; Copyright 2012 <a href="http://mydomain.com/" rel="nofollow">My Domain</a> &middot; All Rights Reserved &middot; Powered by <a href="http://wordpress.org/" rel="nofollow">WordPress</a> &middot; <a href="http://mydomain.com/wp-admin" rel="nofollow">Admin</a></p>
<?php
@wpspeak
wpspeak / functions.php
Created May 13, 2014 19:23
Portfolio Custom Post Type with Custom Icon
<?php
// Create portfolio custom post type
add_action( 'init', 'register_cpt_portfolio' );
function register_cpt_portfolio() {
register_post_type( 'portfolio',
array(
'labels' => array(
@wpspeak
wpspeak / style.css
Created May 5, 2014 15:53
Customize Home Icon in Genesis Framework breadcrumb
.breadcrumb .dashicons.dashicons-admin-home {
color: #de696b;
}
@wpspeak
wpspeak / functions.php
Last active August 4, 2019 06:58
Remove 'You are here' texts in Genesis Framework breadcrumb
<?php
//* Remove 'You are here' texts in Genesis Framework breadcrumb
add_filter( 'genesis_breadcrumb_args', 'afn_breadcrumb_args' );
function afn_breadcrumb_args( $args ) {
$args['labels']['prefix'] = '';
return $args;
}
@wpspeak
wpspeak / functions.php
Created May 5, 2014 15:23
Register Dashicons in WordPress
<?php
//* Enqueue Dashicons icon font
add_action( 'wp_enqueue_scripts', 'afn_dashicons_icon_font' );
function afn_dashicons_icon_font() {
wp_enqueue_style( 'dashicons' );
}
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:18
Add home icon to Genesis Framework breadcrumb
<?php
//* Replace 'Home' text with a home icon in Genesis Framework breadcrumb
add_filter ( 'genesis_home_crumb', 'afn_breadcrumb_home_icon' );
function afn_breadcrumb_home_icon( $crumb ) {
$crumb = '<a href="' . home_url() . '" title="' . get_bloginfo('name') . '"><i class="dashicons dashicons-admin-home"></i></a>';
return $crumb;
}
@wpspeak
wpspeak / functions.php
Created March 15, 2014 22:25
Reposition Jetpack Related Posts Above Post Content
<?php
function jetpackme_move_related_posts_to_top( $options ) {
$options['show_above_content'] = true;
return $options;
}
add_filter( 'jetpack_relatedposts_filter_options', 'jetpackme_move_related_posts_to_top' );