The code I'm using, is outside of WordPress i.e.
define('WP_USE_THEMES', false);
require('blog/wp-blog-header.php');
global $wpdb;
The code that I'm trying to display the post thumbnail (the set featured image) is:
if(has_post_thumbnail($post->ID)){
echo "has a thumb";
get_the_post_thumbnail();
the_post_thumbnail();
the_post_thumbnail('medium');
wp_get_attachment_image_src(get_post_thumbnail_id());
wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ));
} else {
echo "no thumb";
}
Now it does does correctly display if there is a thumb or not, but doesn't return the thumb file name or anything at all. I've tried all methods I could find and nothing is returned, nor is there any errors returned.
Suggestions, thoughts?
wp-load.php
instead ofwp-blog-header.php
. had a few problems lately with code using the latter. also, you have to echo thewp_get_attachment_image_src['0']
, as this returns an Array, and does not print out the details.