Last active
January 10, 2016 14:51
-
-
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
This file contains 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_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