Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active December 20, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/6d27c7027057b4ac083b to your computer and use it in GitHub Desktop.
Save srikat/6d27c7027057b4ac083b to your computer and use it in GitHub Desktop.
// Enables the Excerpt meta box in Page edit screen.
function wpcodex_add_excerpt_support_for_pages() {
add_post_type_support( 'page', 'excerpt' );
}
add_action( 'init', 'wpcodex_add_excerpt_support_for_pages' );
// Register a custom image size for featured images on Pages
add_image_size( 'page-featured', 560, 175, true );
<?php
add_action( 'genesis_after_header', 'sk_featured_section_pages' );
function sk_featured_section_pages() { ?>
<div class="featured-section">
<div class="wrap">
<div class="one-half first">
<?php genesis_do_breadcrumbs();
genesis_do_post_title();
the_excerpt(); ?>
</div>
<div class="one-half">
<?php genesis_image( 'size=page-featured' ); ?>
</div>
</div>
</div>
<?php }
// Remove breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
// Remove entry header
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
// Modify breadcrumb arguments
add_filter( 'genesis_breadcrumb_args', 'sp_breadcrumb_args' );
function sp_breadcrumb_args( $args ) {
$args['sep'] = ' > ';
$args['labels']['prefix'] = '';
return $args;
}
genesis();
.featured-section {
padding: 30px 0;
background-color: #ededed;
border-bottom: 1px solid #d2d2d2;
}
.featured-section .breadcrumb {
margin-bottom: 10px;
}
.featured-section .entry-title {
margin-bottom: 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment