Created
August 10, 2017 03:55
-
-
Save jillmaturino/654a48632683642dce41297fd10b3f54 to your computer and use it in GitHub Desktop.
Genesis Change Featured Image in archive loop
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
// 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