Custom field not working to show featured image

Greetings. I’m following a tutorial for creating custom wordpress themes. I’m told to create a custom field with the name large_preview and for value paste in the URL of an image, which I’ve done in my first post.

In my index.php here’s the part I have that calls for the custom field, I think:

<?php if (get_post_meta($post->ID, ‘large_preview’,true)) { ?>
Featured Post
<?php } ?>

Yet the image does not show besides in the top featured post: http://breakthroughchurch.com/doodling/

Also I do not have the featured image option available in wordpress, I assume because of my custom theme. I tried adding the line “add_theme_support( ‘post-thumbnails’ );” to functions.php but I still do not have option to add freatured image.

Any help offered is much appreciated. Thanks, Chris.

Are you sure you don’t have the set featured image option? If I remember rightly, it’s on the add post page on the right hand side. That’s part of Wordpress not part of the custom theme so it should be there?


Thanks. No, on the right side I have Publish, Catagories and Tags… no featured image. I had it there when I installed WP but since installing my custom theme I’m not seeing it. I thought the answer was it had to be added to functions.php but I’ve tried on no luck.

Is this any use? http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/

It sure is. Strangely I added that line to functions.php before but the one they provided worked. I now have the featured image box. I then had to call for it correctly in index.php and take out references to the large_preview custom field. Thanks a ton.

Glad you got it sorted.

Sponsor our Newsletter | Privacy Policy | Terms of Service