I am trying to get the post thumbnail using post_id,but i am getting so many problems.
Iam calling the function in a separate php file in theme directory
echo get_the_post_thumbnail('637');
Fatal error: Call to undefined function get_the_post_thumbnail() in …
1)can we get the thumbnail using post_id
or
2)can we get the image source using post_id
please any body help me
Thanks in advance
Try this
In your case you make a small mistake that you put the single quote inside the function when function require an integer value.
Bellow code are valid try it.
Simple Form
Size Specified Form where second argument is the size of the image.
also you can try bellow code also
Also you can refer to the WordPress codex Here.
I am also going to write a full post on this topic on my blog
Use Require_once Or include_once
Vallabh’s solution works. This is how I use it as a background image:
Create a post template..look like this(post_temp.php)