I am in a situation with a theme where I can't rely on custom-fields in wordpress and need to use the "featured image" feature instead.
This is the code that calls the custom field
<?php $thumbnail_image = get_post_meta($post->ID, 'post-image', true); ?>
I can't find any docu开发者_StackOverflowmentation on "featured image" in the Wordpress codex, but is it possible to call the url of the featured image of a page in this example?
This should get you going http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail
Edit:
$image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id() );
$image_src = $image_attributes[0];
精彩评论