Created
May 14, 2015 12:43
-
-
Save reasonstousegenesis/777f8dbbd330c194eef6 to your computer and use it in GitHub Desktop.
Demonstration of the args for genesis_get_image
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
<?php | |
// Paste the code BELOW this line into your child theme functions. | |
/** | |
* Demonstration of the args for genesis_get_image | |
* | |
* @author Reasons to Use Genesis | |
* @link http://reasonstousegenesis.com/featured-image/ | |
*/ | |
add_action( 'genesis_entry_content', 'rtug_featured_image_args' ); | |
function rtug_featured_image_args() { | |
$image = genesis_get_image( array( | |
'post_id' => 300, | |
'format' => 'html', | |
'size' => array( 250, 250 ), | |
'attr' => array( 'class' => 'rtug', 'id' => 'rtug' ), | |
'fallback' => array( 'html' => '<img src="rtug.jpg">', 'url' => 'http://reasonstousegenesis.com/rtug.jpg' ), | |
'num' => 1, | |
'context' => 'rtug' | |
) ); | |
if ( $image ) { | |
printf( '<a href="%s" rel="bookmark">%s</a>', get_permalink(), $image ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment