Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sk_add_odd_even_class( $classes ) {
- if ( is_main_query() ) { // conditional to ensure that column classes do not apply to Featured widgets
- global $wp_query;
- if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ) {
- $classes[] = 'odd';
- } else {
- $classes[] = 'even';
- }
- }
- return $classes;
- }
- add_filter( 'post_class', 'sk_add_odd_even_class' );
- // Force full width content
- add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
- // Remove the entry title
- remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
- // Remove post info
- remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
- // Remove the post content
- remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
- // Remove the post image
- remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
- function sk_display_featured_image() {
- if ( $image = genesis_get_image( 'format=url&size=full' ) ) {
- printf( '<div class="featured-image"><a href="%s" rel="bookmark"><img src="%s" alt="%s" /></a></div>', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
- }
- }
- // Remove entry meta from entry footer incl. markup
- remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
- remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
- remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
- // Add classes to .entry-header
- add_filter( 'genesis_attr_entry-header', 'custom_attributes_entry_header' );
- function custom_attributes_entry_header( $attributes ) {
- $attributes['class'] .= ' one-half first';
- return $attributes;
- }
- // Add classes to .entry-content
- add_filter( 'genesis_attr_entry-content', 'custom_attributes_entry_content' );
- function custom_attributes_entry_content( $attributes ) {
- $attributes['class'] .= ' one-half';
- return $attributes;
- }
- add_action( 'genesis_before_entry', 'sk_alternate_image_content' );
- function sk_alternate_image_content() {
- global $wp_query;
- if( 0 == $wp_query->current_post || 0 == $wp_query->current_post % 2 ) {
- add_action( 'genesis_entry_header', 'genesis_do_post_title' );
- add_action( 'genesis_entry_header', 'genesis_do_post_content' );
- add_action( 'genesis_entry_content', 'sk_display_featured_image' );
- add_action( 'genesis_entry_content', 'genesis_post_info' );
- add_action( 'genesis_entry_content', 'genesis_post_meta' );
- } else {
- // remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
- // remove_action( 'genesis_entry_header', 'genesis_do_post_content' );
- // add_action( 'genesis_entry_header', 'sk_display_featured_image' );
- // add_action( 'genesis_entry_header', 'genesis_post_info' );
- // add_action( 'genesis_entry_header', 'genesis_post_meta' );
- // remove_action( 'genesis_entry_content', 'sk_display_featured_image' );
- // remove_action( 'genesis_entry_content', 'genesis_post_info' );
- // remove_action( 'genesis_entry_content', 'genesis_post_meta' );
- // add_action( 'genesis_entry_content', 'genesis_do_post_title' );
- // add_action( 'genesis_entry_content', 'genesis_do_post_content' );
- }
- }
- genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement