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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -