Created
November 3, 2016 14:07
-
-
Save erkiziltoprak/80d372de3b24a59fdc8609ea77ebc116 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// This file handles single entries, but only exists for the sake of child theme forward compatibility. | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); | |
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 12 ); | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
add_action( 'genesis_entry_header', 'genesis_post_info', 3 ); | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); | |
add_action( 'genesis_entry_header', 'jan_featured_img', 1 ); | |
function jan_featured_img() { | |
if ( has_post_thumbnail() ) { // checks post has thumbnail | |
// gets URL for that image | |
$background = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'featured-image' ); | |
if (is_array($background)) { | |
// echo the output | |
echo '<div class="entry-header-wrap"><div class="entry-header-bg" style="background: url(' ; | |
echo $background[0]; | |
echo ') ">'; | |
echo '</div></div>'; | |
}} | |
else { // if no featured image, adds class to use default image | |
echo '<div class="entry-header-wrap"><div class="entry-header-bg">'; | |
genesis_widget_area( 'ontop', array( | |
'before' => '<div class="features-widgetarea">', | |
'after' => '</div>', | |
) ); | |
echo '</div></div>'; | |
}} | |
add_filter( 'genesis_post_info', 'sp_post_info_filter' ); | |
function sp_post_info_filter($post_info) { | |
$post_info = '[post_date] / [post_categories] '; | |
return $post_info; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment