Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.