Secondary Image URL
-
hello, i’ve read a lot of different topics about my problem. but can’t seem to find any solution..
I have articles, each of them have two thumnails. The main one, and the secondary-thumbnail one, generated with multiple post thumbnails.
I’m trying to return only the URL of the secondary image, in my single.php as an inline CSS.
my code is like that :
<div class="article-img" style=" background-image: url( <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array(1900,800), false, ” ); echo $src[0];?>); background-size:cover;"> </div>
what am I supposed to do ? I’ve pretty much tried everything. I know that at the moment it returns the URL of the main Thumbnail. Don’t know how to change that.
thank you in advance.
Estelle
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Secondary Image URL’ is closed to new replies.