How to get the featured image url from a WordPress post

How to get the featured image url from a WordPress post

This is going to be a very quick recipy.

Two lines I always use in order to obtain the url for the featured image, full size. This could be useful if you want full control of the code, like placing the image as a background for a box, instead of relying on the img tag that the_post_thumbnail() outputs.

Here you are:

<?php
     // GET IMAGE LINK
     $thumbfull = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
     urlfull = $thumbfull['0']; 
?>

Now you can use $urlfull wherever you wish.

Bruce Mozert’s underwater geniality

Next Article

Bruce Mozert's underwater geniality

3 Comments

Cancel

  1. elles photos sont supers jolies bonne acquisition le foulard tu vas pouvoir le mettre à toutes les sauces comme on dit Je ne suis jamais allé au centre Pompidou, tu me donnes envie, bisous bisous bichette !

  2. Hallo Ihr Lieben,ich habe die Hörprobe genossen. Hat mir und meiner Frau sehr gut gefallen. Ich wünsche Eurem Chor alles Gute. Weiter so.Grüße an einen meiner besten Freunde, Andreas Sawinski.Liebe GrüßeHarry und Ina

  3. Isaac︰『如果說,為了道德責任對人類社會的重要性(或者根本性),即使放棄了我們現在普遍接受的自由意志理論,人類社會依然會繼續利用道德責任的概念運作下去,但這個「繼續運作」不會是一個無痛的過程,而且會是一個很痛的過程,尤其當這個轉變甚至必須擴大到其它領域例如愛、創意、自我……等等概念時,這是我提這些概念用意。』我同意。我想,我說的拋棄自由意志,指的是拋棄自由意志「as alternative possibilities」的觀點。我說的造成ontology比較大的東西,指的也是那個。