php - WordPress Display image where path is custom post type field -
i have custom post type , image path field. however, when such below code doesn't display. path in database, confirmed:
<?php $imgurl = $fields['wpcf-portrait'][0]; ?> <img src="<?php $imgurl; ?>">
i've tried few different things when inspect element says "null" src url supposed be.
you need "echo" path.
the correct code be:
<?php $imgurl = $fields['wpcf-portrait'][0]; ?> <img src="<?php echo $imgurl; ?>">
Comments
Post a Comment