This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpsites_exclude_category_feed($query) { | |
if ($query->is_feed) { | |
$query->set('cat','-007'); | |
} | |
return $query; | |
} | |
/** | |
* @author Brad Dalton | |
* @example http://wpsites.net/ | |
* @copyright 2014 WP Sites |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.post-photo { | |
margin-bottom: 35px; | |
display: block; | |
margin: 0 auto 2.4rem; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'magazine_custom_loop_helper' ); | |
/* | |
Template Name: Custom | |
*/ | |
function magazine_custom_loop_helper() { | |
if ( is_active_sidebar( 'custom-top' ) || is_active_sidebar( 'custom-left' ) || is_active_sidebar( 'custom-right' ) || is_active_sidebar( 'custom-bottom' ) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Register widget areas */ | |
genesis_register_sidebar( array( | |
'id' => 'custom-top', | |
'name' => __( 'Custom Top', 'magazine' ), | |
'description' => __( 'This is the custom top section.', 'magazine' ), | |
) ); | |
genesis_register_sidebar( array( | |
'id' => 'custom-left', | |
'name' => __( 'Custom Left', 'magazine' ), | |
'description' => __( 'This is the custom left section.', 'magazine' ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Custom Page Template With Widgets | |
------------------------------------------------------------ */ | |
.custom-bottom, | |
.custom-middle, | |
.custom-top { | |
clear: both; | |
font-size: 13px; | |
line-height: 20px; | |
margin: 0 0 20px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genesis_register_sidebar( array( | |
'id' => 'home-slider', | |
'name' => __( 'Home Slider', 'prose' ), | |
'description' => __( 'This is the slider widget area for your homepage.', 'prose' ), | |
) ); | |
add_action( 'genesis_before_content_sidebar_wrap', 'child_before_content_sidebar_wrap'); | |
function child_before_content_sidebar_wrap'() { | |
if ( is_home() && is_active_sidebar( 'home-slider' ) ) { | |
echo '<div id="home-slider">'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('genesis_before_sidebar_widget_area', 'wpsites_banner_function'); | |
function wpsites_banner_function() { | |
echo '<div class="widget-logo"><img src="http://yourdomain.com/wp-content/uploads/2013/03/image.png" alt="widget logo" /></div>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('genesis_before_sidebar_widget_area', 'wpsites_home_function'); | |
function wpsites_home_function() { | |
if (is_home() ) | |
echo '<div class="sidebar-home"><img src="http://yourdomain.com/wp-content/uploads/2013/03/yourimage.png" alt="sidebar home logo" /></div>'; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'genesis_after_post_title', 'wpsites_after_post_title_featured_image' ); | |
function wpsites_after_post_title_featured_image() { | |
if ( is_single() ) return; | |
if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) { | |
printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) ); | |
} | |
} |