Lyra Theme: Feature Image

I want to feature an image on my front page but at the same time I do not want the image appear on the post after it is opened. I tried altering the code to no avail. Error message reads something about a valid handlebars template.

So front page - the featured image is showing.
Opening the post - no featured image is being displayed.

1 Like

In post.hbs, remove this.
{{#if feature_image}} <figure class="post-full-image"> {{!-- This is a responsive image, it loads different sizes depending on device https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}} <img srcset="{{img_url feature_image size="s"}} 300w, {{img_url feature_image size="m"}} 600w, {{img_url feature_image size="l"}} 1000w, {{img_url feature_image size="xl"}} 2000w" sizes="(max-width: 800px) 400px, (max-width: 1170px) 1170px, 2000px" src="{{img_url feature_image size="xl"}}" alt="{{title}}" /> </figure> {{/if}}

Got it- thanks

Thanks for sharing worked a treat!

Another way to do this without editing any templates, is to simply add the following in your Site >> Settings >> Code Injection >> Site Header at https://your-site.com/ghost/#/settings/code-injection

.post-full-image {display:none}