How can I append custom data to images in the editor?

Use get_post_meta(); in your template to get that metadata attached to that image.

<div class="img-holder">
    <img src="https://dummyimage.com/300x200/bada55/0011ff&text=300x200" alt="">
    <p class="img-number"><?php echo get_post_meta($post->ID, '_image_number', true) ?></p>
</div>

Leave a Comment

tech