• i use FILE UPLOAD to upload the image and use the code to show it in the template, everything is really good but the problem is that when having uploaded the image the plugin enters a number into the image custom field value like “7345” but i want the plugin that after upload enter the file URL into the custom field so that I can show the image easily in the in my template. any suggestion?

    [thumb]
    type = file
    label = ????? ????
    relation = true

    <img src="<?php echo get_post_meta($post->ID, 'thumb',true); ?>" />

    custom field template value is now
    76371
    i want it to be like this url
    https://www.mydomain.com/wp-content/uplods/2010/09/image.jpg

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think the “random” number it is showing is the ID of the media. I’ve been searching for exactly the same answer as you, and I’ll post if I find something. Hopefully there is someone out there that knows.

    Ah, well that didn’t take long. I found the answer in a different thread. I hope this is what you are looking for.

    Example…
    Your CFT setting:
    [Image]
    type = file
    label = Upload Image
    relation = true

    Your template code:
    <?php $imageid = get_post_meta($post->ID, ‘Image’, true); ?>
    <img src=”<?php echo wp_get_attachment_url( $imageid ); ?>” />

    Pulled the image perfectly for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Custom Field Template] display an image with url?’ is closed to new replies.