Blog Index - Posts with Thumbnails
-
Hi People,
How to insert thumbnails in homepage of Blog ?Example:
Post1: Image + post attributes
Post2: Image + post attributes
...<img src="{{ Imagy::getThumbnail($post->media__imageables->media_files->path, 'blogThumb') }}" alt="" />
Thanks in advanced
Léo
-
Hello,
You're close.
On top of my head:<img src="{{ Imagy::getThumbnail($post->files->first()->path, 'blogThumb') }}" alt="" />
You could always send a PR so that it's a little more nicer, for instance:
<img src="{{ Imagy::getThumbnail($post->featured_image->path, 'blogThumb') }}" alt="" />
-
$post_array = $post->files()->first(); <img src="{{ $post_array['path'] }}" alt="{{ $post_array['filename'] }}">