Answers for "get image url wordpress"

PHP
1

get featured image url in wordpress

if ( has_post_thumbnail()) {
   $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
   echo '<a href="' . $large_image_url[0] . '">';
   the_post_thumbnail('thumbnail');
   echo '</a>';
}
Posted by: Guest on January-05-2021
0

wordpress get uploads images url

wp_get_attachment_image_src( int $attachment_id, string|int[] $size = 'thumbnail', bool $icon = false )
Posted by: Guest on June-01-2021

Code answers related to "get image url wordpress"

Browse Popular Code Answers by Language