Skip to content

Instantly share code, notes, and snippets.

@jillmaturino
Created August 10, 2017 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jillmaturino/654a48632683642dce41297fd10b3f54 to your computer and use it in GitHub Desktop.
Save jillmaturino/654a48632683642dce41297fd10b3f54 to your computer and use it in GitHub Desktop.
Genesis Change Featured Image in archive loop
// Change featured image links to remove https
remove_action( 'genesis_entry_header', 'genesis_do_post_image', 5 );
add_action( 'genesis_before_entry', 'featured_image_no_https', 12 );
function featured_image_no_https() {
$image = genesis_get_image( array(
'size' => 'thumbnail', 'format' => 'html',
'attr' => array ( 'alt' => the_title_attribute( 'echo=0' ), 'class' => 'post-image' )
) );
if ( $image ) {
$relative_permalink = force_relative_url (get_permalink ($post->ID));
$permalinks="http://cdcgamingreports.com".$relative_permalink;
printf( '<a class="entry-image-link" href="%s">%s</a>', __($permalinks), $image );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment