Support » Fixing WordPress » Custom field, image and alt tags

  • 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>

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Custom field, image and alt tags’ is closed to new replies.