Skip to content

Instantly share code, notes, and snippets.

@alexmustin
Last active April 18, 2018 18:52
Show Gist options
  • Save alexmustin/85d0117c253479ea864b3335c3be3c3b to your computer and use it in GitHub Desktop.
Save alexmustin/85d0117c253479ea864b3335c3be3c3b to your computer and use it in GitHub Desktop.
CoachingPro theme setup modification -- disable first image as Featured Image
<?php
// Copy/Paste this code to overwrite the current code, starting at Line 220 of /coaching-pro/lib/theme-setup.php
add_action( 'genesis_entry_header', 'coaching_pro_show_featured_post_image', 1 );
function coaching_pro_show_featured_post_image() {
// only show on single posts and pages
if ( ! is_single() && ! is_page() || ! has_post_thumbnail() ) {
return;
}
if ( $image = genesis_get_image( 'format=url&size=featured-image' ) ) {
printf( '<img class="post-photo aligncenter" src="%s" alt="%s" />', $image, the_title_attribute( 'echo=0' ) );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment