-
-
Save jamiemitchell/8326c66670889ccc02a5 to your computer and use it in GitHub Desktop.
Demonstration of the args for genesis_get_image
This file contains hidden or 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