Skip to content

Instantly share code, notes, and snippets.

View JiveDig's full-sized avatar

Mike Hemberger JiveDig

View GitHub Profile
@JiveDig
JiveDig / Add span to part of site title
Created May 10, 2013 17:11
Genesis specific. Add span to part of the site title.
// Add span to part of the site title
add_action( 'genesis_site_title', 'thestiz_seo_site_title' );
function thestiz_seo_site_title() {
echo '<p id="title"><a href="/">The Stiz <span>Media</span></a></p>';
}
@JiveDig
JiveDig / Add previous and next links on single posts
Last active December 17, 2015 05:09
Add previous/next links to single posts
@JiveDig
JiveDig / Add Font Awesome social icons to the footer.
Created May 10, 2013 17:23
Add Font Awesome social icons to the footer.
@JiveDig
JiveDig / Replace site title with an inline logo
Last active December 17, 2015 05:09
Replace site title with an inline logo
@JiveDig
JiveDig / Add phone number to header right
Created May 10, 2013 18:11
Add phone number with click to call to header right hook in Genesis.
// Add phone number above nav, also add mobile menu
add_action( 'genesis_header_right', 'vp_call_us' );
function vp_call_us() {
if(strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'mobile') || strstr(strtolower($_SERVER['HTTP_USER_AGENT']), 'android')) {
echo '<div class="vp-call-us"><a href="tel:908-852-7028">Click to call! (908) 852-7028</a></div>';
} else {
echo '<div class="vp-call-us">(908) 852-7028</div>';
}
}
@JiveDig
JiveDig / Customize the return to top of page text
Last active December 17, 2015 05:09
Customize the return to top of page text in Genesis.
// Customize the return to top of page text
add_filter( 'genesis_footer_backtotop_text', 'custom_footer_backtotop_text' );
function custom_footer_backtotop_text($backtotop) {
$backtotop = '[footer_backtotop text="Back to Top"]';
return $backtotop;
}
@JiveDig
JiveDig / Remove and add new post meta
Last active December 17, 2015 05:19
Remove and add new post meta
// Remove/Add new post meta
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
add_action( 'genesis_after_post_content', 'thestiz_portfolio_post_meta' );
function thestiz_portfolio_post_meta() {
echo '<div class="post-meta">';
echo '<p>' . get_the_term_list( $post->ID, 'portfolio_cat', 'Filed in: ', ' ', '' ) . '</p>';
echo '<p>' . get_the_term_list( $post->ID, 'portfolio_tag', 'Tagged: ', ' ', '' ) . '</p>';
echo '</div>';
}
@JiveDig
JiveDig / Remove post info and meta info.php
Created May 10, 2013 19:22
Remove post info and meta info (entry meta)
//* Remove the entry meta in the entry header (requires HTML5 theme support)
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
//* Remove the entry footer markup (requires HTML5 theme support)
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
//* Remove the entry meta in the entry footer (requires HTML5 theme support)
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
<?php
// Customize search form input box text
add_filter( 'genesis_search_text', 'custom_search_text' );
function custom_search_text($text) {
return esc_attr( 'Search my blog...' );
}
// Customize search form input button text
add_filter( 'genesis_search_button_text', 'custom_search_button_text' );
@JiveDig
JiveDig / post_class_columns.php
Last active June 11, 2016 00:06
Use post_class (post class) to break post into columns Last example shows how to conditionally use post class, for specific templates or pages
/**
* Breaks the posts into 4 columns
* @link http://www.billerickson.net/code/grid-loop-using-post-class
*/
add_filter( 'post_class', 'tsm_archive_post_class' );
function tsm_archive_post_class( $classes ) {
global $wp_query;
// Keeps columns out of secondary loops ie: Genesis Featured Post widgets
if( ! $wp_query->is_main_query() ) {
return $classes;