Wordpress Simple Fields Plugin - Show Images


/ Published in: PHP
Save to your folder(s)

Bring in a file / image to your wp template


Copy this code and paste it in your HTML
  1. ?php
  2. $image_id = get_post_meta(get_the_ID(), "your-id-here", true, 2);
  3. $img_src = wp_get_attachment_url($image_id, 'thumbnail');
  4. ?>
  5. <img src="<?php echo $img_src ?>" alt="An image" />

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.