Skip to content

Instantly share code, notes, and snippets.

@simbasounds
Last active January 10, 2016 14:51
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 simbasounds/87cf62b02de5fbd19166 to your computer and use it in GitHub Desktop.
Save simbasounds/87cf62b02de5fbd19166 to your computer and use it in GitHub Desktop.
A portfolio custom post type archive with title, excerpt and thumbnail hooking into Genesis Framework
<?php
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_after_entry_content', 'add_entry_header' );
function add_entry_header() {
genesis_entry_header_markup_open();
echo "<div class='portfolio-block-info'>";
genesis_do_post_title();
the_excerpt();
echo "</div>";
genesis_entry_header_markup_close();
}
add_action('genesis_entry_content', 'post_thumbnail');
function post_thumbnail() {
if ( has_post_thumbnail() ) { ?>
<a href="<?php echo get_page_link(); ?>" title="<?php echo get_the_title(); ?>">
<?php the_post_thumbnail( $size, $attr ); ?>
</a>
<?php }
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment