Skip to content

Instantly share code, notes, and snippets.

@ZellSnippets
ZellSnippets / gist:6562526
Created September 14, 2013 14:34
PHP: WP: Genesis Shortcodes
<?
// Post Shortcodes
[post_date]
[post_time]
[post_author]
[post_author_link]
[post_author_posts_link]
[post_comments]
[post_tags]
[post_categories]
@ZellSnippets
ZellSnippets / gist:6562600
Created September 14, 2013 14:42
PHP: WP: Genesis Footer Text
// Change Footer Creds Text
add_filter( 'genesis_footer_creds_text', 'wk_footer_text' );
function wk_footer_text() {
return '[footer_copyright] <a href="http://www.zell-weekeat.com">Zell Liew</a>';
// return 'Copyright [footer_copyright] [footer_childtheme_link] &middot; [footer_genesis_link] [footer_studiopress_link] &middot; [footer_wordpress_link] &middot; [footer_loginout]';
}
@ZellSnippets
ZellSnippets / gist:6562627
Created September 14, 2013 14:47
PHP: WP: Genesis Footer: Back to top text
// Change back to top text
add_filter( 'genesis_footer_backtotop_text', 'zell_footer_backtotop_text' );
function zell_footer_backtotop_text($backtotop) {
$backtotop = '[footer_backtotop text="Return to Top"]';
return $backtotop;
}
@ZellSnippets
ZellSnippets / gist:6562754
Created September 14, 2013 15:06
PHP: WP: Enqueue Styles
// Enqueue stylesheets
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
add_action( 'wp_enqueue_scripts', 'zell_load_stylesheets' );
function zell_load_stylesheets() {
if( !is_admin() ) {
// Main theme stylesheet
wp_enqueue_style( 'zell', get_stylesheet_directory_uri() . '/css/style.css', array(), null );
@ZellSnippets
ZellSnippets / gist:6562890
Created September 14, 2013 15:22
WP: Enqueue Javascript
/**
* Load scripts
*
* Only load these scripts on the front-end.
*
* @since 2.0.0
*/
add_action( 'wp_enqueue_scripts', 'zell_scripts' );
@ZellSnippets
ZellSnippets / gist:6562944
Created September 14, 2013 15:30
PHP: Genesis: Change favicon paths
add_filter('genesis_pre_load_favicon', 'zell_load_favicon');
function zell_load_favicons() {
$favicon_path = get_stylesheet_directory_uri().
'/images/favicons';
// Use a 144px X 144px PNG for the latest iOS devices
echo '<link rel="apple-touch-icon" href="'.$favicon_path.
'/favicon-144.png">';
@ZellSnippets
ZellSnippets / gist:6562952
Created September 14, 2013 15:31
PHP: Genesis reposition navigation
// reposition navigation
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_header', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
add_action( 'genesis_sidebar_alt', 'genesis_do_subnav' );
@ZellSnippets
ZellSnippets / gist:6562954
Created September 14, 2013 15:32
PHP: Genesis Structural Wrap
// remove structural wraps for nav and subnav
add_theme_support( 'genesis-structural-wraps', array(
'header',
'site-inner',
'footer-widgets',
'footer'
) );
@ZellSnippets
ZellSnippets / gist:6562964
Created September 14, 2013 15:33
PHP: Genesis add stuff after post
// Add signup incentives after every post
add_action( 'genesis_before_comments', 'zell_post_subscribe_box' );
function zell_post_subscribe_box() {
if ( is_single() ) {
echo '<div class="feature-box">';
echo do_shortcode( '[contact-form-7 id="341" title="Mail Chimp Signup"]' );
// echo do_shortcode( '[contact-form-7 id="1175" title="Mail Chimp Signup Form WK DRAFT"]' );
echo '</div><!-- end .feature-box -->';
@ZellSnippets
ZellSnippets / gist:6562988
Created September 14, 2013 15:35
PHP: Genesis remove navigation
remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_after_header', 'genesis_do_subnav' );