• I’m using Image Type “Featured Image” to display those on the front page. There is an option to add a link to the image, but I want the link to always go to the blog post that the image belongs to. So that instead of just clicking the headline for that post, the user can click the image as well, and then come to the single page of that post.

    Yes I know, the plugin is not being updated with new features!

    At least I can confirm it works well with WordPress 5.8 and Genesis 3.3.4.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi Karl,

    Thanks for reaching out. You can do this with the Raw Content option, which gives you complete control over the output of the block.

    Here is some example code to get you started. You will likely need to apply some styling to get it to look exactly how you want, but this will display the Featured Image that is linked to the post of that image.

    <div class="your-custom-class">
    	<a href="<?php echo get_permalink(); ?>">
    		<?php echo get_the_post_thumbnail( $post_id, 'full'); ?>
    	</a>
    </div>

    When using the Raw Content option. Just make sure you have checked the “Check to enable PHP code” option.

    Best,
    Nick

    Thread Starter Karl Andersson

    (@swekarl)

    Thanks Nick! Works beautifully.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can the featured image be linked to the post it belongs to?’ is closed to new replies.