Created
September 14, 2019 13:17
-
-
Save topleague/9a75c390364cf64e5ae79b4af763a960 to your computer and use it in GitHub Desktop.
Replicate Single Post Template of Journal Theme
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
//* Force full-width-content layout | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); | |
//* Remove post meta | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
//* Re-position post info | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
add_action( 'genesis_entry_header', 'genesis_post_info', 1 ); | |
//* Customize the post info function | |
add_filter( 'genesis_post_info', 'post_info_filter' ); | |
function post_info_filter( $post_info ) { | |
$post_info = '[post_date]'; | |
return $post_info; | |
} | |
//* Add a post featured image size | |
add_image_size( 'post-image', 1400, 500, TRUE ); | |
//* Add featured image | |
add_action( 'genesis_before_entry', 'journal_featured_image', 0 ); | |
function journal_featured_image() { | |
global $post; | |
if( has_post_thumbnail() ) { | |
echo ' | |
<div class="featured-image">'; | |
if( ! is_single() ) | |
echo '<a href="' . get_permalink() . '">'; | |
the_post_thumbnail( 'post-image' ); | |
if( ! is_single() ) | |
echo '</a>'; | |
echo '</div> | |
'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment