Thumbnail URL isn't loading
-
Hi,
I am trying to pull in my thumbnail URL, as it has a class and a data attribute, but it doesn’t load in the thumbnail. If I just have it as
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(array('full')); }?>
it works but I need the URL, not the image.See my code below:
<div class="blog__item"> <?php echo '<a href="',the_permalink(),'" class="blog__item__ftd-img" data-bg- img="',the_post_thumbnail_url(),'"></a>'; ?> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <?php the_excerpt('<p>','</p>'); ?> <?php the_date('F, Y', '<span class="date">', '</span>'); ?> </div>
Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Thumbnail URL isn't loading’ is closed to new replies.