I am trying to print url of the thumbnail out side the wordpress directory, the url works but the problem is I am always getting a number before that url.
This is the code I am playing with,
<?php require($_SERVER['DOCUMENT_ROOT'] . '/personal/wordpress/wp-load.php'); query_posts('showposts=1'); if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php echo wp_get_attachment_thumb_url( get_post_thumbnail_id( the_id() ) )?>
<?php endwhile; else: echo "no posts"; endif; ?>
This is the output:
5http://localhost/personal/wordpress/wp-content/uploads/2013/10/facebookhero-150x150.jpg
I have already tried string replace, like this str_replace(the_id(),"", wp_get_attachment_thumb_url( get_post_thumbnail_id( the_id() ))
but it does not work, in fact when I have tried:
<?php echo "|".wp_get_attachment_thumb_url( get_post_thumbnail_id( the_id() ) )?>
Most interestingly this is what I get:
5|http://localhost/personal/wordpress/wp-content/uploads/2013/10/facebookhero-150x150.jpg