Skip to content

Instantly share code, notes, and snippets.

@erkiziltoprak
Created November 3, 2016 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save erkiziltoprak/80d372de3b24a59fdc8609ea77ebc116 to your computer and use it in GitHub Desktop.
Save erkiziltoprak/80d372de3b24a59fdc8609ea77ebc116 to your computer and use it in GitHub Desktop.
<?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] &nbsp; / &nbsp; [post_categories] ';
return $post_info;
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment