• Hi!

    I’m looking to do something really simple, but I can’t seem to understand how to use custom fields!

    I’d like my single page layout to ONLY show the image referenced in the custom field “image_url”.

    Can anyone help me figure it out? I’m good with html and css, I’m not so great with php, and this is a real headscratcher!

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m good with html and css

    cool, this is a good start.
    so, ideally, could you post the html structure of how you would like your single post to look like, and someone might be able to show you where and how to put the php code into it.

    in general, where you would like to see the content of your first value of your custom field, use:
    <?php echo get_post_meta($post->ID,'image_url',true); ?>

    if your custom field value is the absolute url of your image, then to show the image in a html context would look like:
    <img src="<?php echo get_post_meta($post->ID,'image_url',true); ?>" alt="" />

    Thread Starter Marie-Charlotte Pezé

    (@karlotta)

    Thank you so much alchymyth for your solution, this is perfect!

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Field help’ is closed to new replies.