-
-
Save bpmore/d9943265fd68f4c8ab0d to your computer and use it in GitHub Desktop.
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
add_action( 'genesis_entry_content', 'os_show_featured_image_single_posts', 9 ); | |
function os_show_featured_image_single_posts() { | |
global $post; | |
if ( ! is_singular( 'post' ) ) { | |
return; | |
} | |
// Get the featured image HTML | |
$image_html_args = array( | |
'size' => 'post-image', | |
'attr' => array( | |
'class' => 'aligncenter featured-image size-full wp-image-' . $post->ID .'', | |
), | |
); | |
$image_html = genesis_get_image( $image_html_args ); | |
// Get the featured image URL for the lightbox a href only | |
$image_url_args = array( | |
'format' => 'url', | |
); | |
$image_url = genesis_get_image( $image_url_args ); | |
// Display the Image using both calls above | |
echo '<a rel="lightbox" href="' . $image_url . '">'. $image_html .'</a>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment