Skip to content

Instantly share code, notes, and snippets.

@studiopress
studiopress / pinterest-horizontal.php
Last active December 17, 2015 15:59
Genesis Pinterest button.
<?php
//* Add Horizontal Pinterest button
add_action( 'genesis_post_content', 'sp_pinterest_button', 5 );
function sp_pinterest_button() {
printf( '<div class="pinterest-button"><a href="http://pinterest.com/pin/create/button/?url=%s&media=%s" class="pin-it-button" count-layout="horizontal">Pin It</a><script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script></div>', urlencode( get_permalink() ), urlencode( genesis_get_image( array( 'format' => 'url' ) ) ) );
}
@studiopress
studiopress / add-featured-image-size.php
Last active January 14, 2017 02:40
Genesis grid loop.
@studiopress
studiopress / columns.css
Last active August 10, 2023 13:50
Genesis column classes.
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
@studiopress
studiopress / force-layout-settings.php
Last active June 24, 2021 21:01
Genesis admin management.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
//* Force sidebar-content layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_sidebar_content' );
//* Force content-sidebar-sidebar layout setting
@studiopress
studiopress / credits-1.php
Last active April 26, 2023 15:09
Genesis footer.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the credits
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
function sp_footer_creds_text() {
echo '<div class="creds"><p>';
echo 'Copyright &copy; ';
echo date('Y');
echo ' &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
@studiopress
studiopress / customize.php
Last active November 15, 2016 14:37
Genesis post info.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}}
@studiopress
studiopress / customize.php
Last active June 30, 2018 18:49
Genesis post meta.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]';
return $post_meta;
}}
@studiopress
studiopress / reposition-primary.php
Last active January 14, 2017 02:44
Genesis primary/secondary navigation.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );
@studiopress
studiopress / genesis-read-more.php
Last active August 10, 2020 09:51
Genesis post excerpts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the Genesis content limit read more link
add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '... <a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
}
@studiopress
studiopress / author-box.css
Last active March 26, 2018 13:57
Genesis author box.
/* Author Box
------------------------------------------------------------ */
.author-box {
background-color: #f5f5f5;
border: 1px solid #ddd;
margin: 0 0 40px;
overflow: hidden;
padding: 10px;
}