Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
Created May 14, 2015 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save reasonstousegenesis/777f8dbbd330c194eef6 to your computer and use it in GitHub Desktop.
Save reasonstousegenesis/777f8dbbd330c194eef6 to your computer and use it in GitHub Desktop.
Demonstration of the args for genesis_get_image
<?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