• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / Genesis / Example of using genesis_get_image with its arguments

Example of using genesis_get_image with its arguments

add_action( 'genesis_entry_header', 'sk_image', 9 );
/**
 * Outputs image linking to permalink.
 */
function sk_image() {

    $image_args = array(
        'size' => 'custom-square-thumbnail',
        'attr' => array(
            'class' => 'alignleft',
        )
    );

    // Get the featured image HTML.
    $image = genesis_get_image( $image_args );

    echo '<a rel="bookmark" href="'. get_permalink() .'">'. $image .'</a>';

}

Posted by: Sridhar Katakam Category: Genesis Tags: genesis_get_image

« Set up custom loop in Genesis
Modify the site-title URL »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in