• Goal: Display a rotating set of images linked to specific posts.

    Howto:

    1. Create a custom field called ‘RotatingPostCover’
    2. In each post that I want to show up, an image link (https://blogname.com/wp-content/whatever.jpg’) is inserted as the value of the custom field.
    3. In the code, I assign $postKey = get_post_custom_values('RotatingPostCover', $post->ID); and

    echo " <div class='rp_post_content'><img src='{$postKey}' /></div>\n";

    4. Currently, I am ending up with this output:
    <div class='rp_post_content'><img src='Array' /></div>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Field Output – Code Help Needed’ is closed to new replies.