Skip to content

Instantly share code, notes, and snippets.

View braddalton's full-sized avatar

Brad Dalton braddalton

View GitHub Profile
function wpsites_content_columns_before_posts() {
if ( is_single() ) {
echo '<div class="one-half first">This is an example of one half first content columns.</div>';
echo '<div class="one-half">This is an example of one half content columns.</div>';
}
}
add_action('genesis_before_post', 'wpsites_content_columns_before_posts');
/* Styling Content Columns
------------------------------------------------------------ */
.one-half {
border-bottom: double #ddd;
border-top: double #ddd;
background-color:#F5F5F5;
font-family: Georgia;
font-size: 18px;
line-height: 1.0;
function wpsites_content_columns_after_posts() {
if ( is_single() ) {
echo '<div class="one-half first">This is an example of one half content columns.</div>';
echo '<div class="one-half">This is an example of one half content columns.</div>';
}
}
add_action('genesis_after_post', 'wpsites_content_columns_after_posts');
function wpsites_archive_intro_text() {
if ( !is_category() && !is_tag() && !is_tax() )
return;
if( get_query_var( 'paged' ) )
return;
echo '<h1 class="entry-title">'.single_term_title('', false).'</h1>';
echo '<div class="entry-content">'.wpautop( term_description() ).'</div>';
// Register Widget
genesis_register_sidebar( array(
'id' => 'featured-bottom',
'name' => __( 'After Content Home ', 'focus' ),
'description' => __( 'This is the after content home page widget.', 'focus' ),
) );
// Hook Widget After Content Home Page Only
add_action( 'genesis_after_content_sidebar_wrap', 'wpsites_after_content_home', 9 );
@braddalton
braddalton / Front Page Feature Box
Last active December 15, 2015 15:39
Use this code when using a static page as your home page in the WordPress Reading Settings.
/** Register Featured Box widget area */
genesis_register_sidebar( array(
'id' => 'featured-box',
'name' => __( 'Featured Box', 'genesis' ),
'description' => __( 'This is the featured box.', 'genesis' ),
) );
/** Add Featured Box after header on homepage */
function display_posts_shortcode_home() {
if (is_home()) {
echo do_shortcode('[display-posts id="14,3"]');
}
};
add_action('genesis_after_content', 'display_posts_shortcode_home');
/** Register sub widget areas */
genesis_register_sidebar( array(
'id' => 'sub-widget-left',
'name' => __( 'Sub Widget Left', 'child' ),
'description' => __( 'This is the sub widget left section.', 'child' )
) );
genesis_register_sidebar( array(
'id' => 'sub-widget-right',
'name' => __( 'Sub Widget Right', 'child' ),
'description' => __( 'This is the sub widget right section.', 'child' )
/* Sub Widgets
------------------------------------------------------------ */
#sub-widget {
background-color: #ddd;
clear: both;
color: #333;
font-size: 16px;
margin: 0 auto;
overflow: hidden;