Custom field, image and alt tags (2 posts)

  1. erichmond
    Posted 6 years ago #

    I have a custom field that grabs an image but I then would like the Caption or Alt tag for that image that was upload through the wp media option

    <img src="<?php $key="right_col_img"; echo get_post_meta($post->ID, $key, true); ?>" alt="****how can I echo the alt tag for this image*****" /></div>

  2. tomontoast
    Posted 6 years ago #

    On one of my blogs I have two custom fields one for the image url and one for the image alt. Otherwsie it gets a bit messy and requires a custom database call. Can be done though.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.