Support » Plugins » Custom fields in WP 3.0

  • I installed the WP Featured Content Slider plugin which almost works perfectly in WP 3.0.

    My problem is it displays the post title and contents but not the custom field which is for a thumbnail image.

    The php code is as follows:

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

    Is there something different in WP 3.0 which is preventing this from working? Do I need to change syntax? Any help would be great thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you change $post->ID to get_the_ID() does that make a difference? Like so:

    <?php $gallery = get_post_meta(get_the_ID(), 'Thumbnail', $single = true); ?>
    <img src="<?php echo $gallery; ?>" alt="" />

    Brilliant thanks, thats fixed it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom fields in WP 3.0’ is closed to new replies.