Reputation: 2673
In the template which I've used for my blog this js method
document.write(bp_thumbnail_resize("<data:post.thumbnailUrl/>","<data:post.title/>"))
is used to add a thumbnail to each post as far as I understood. But I don't know how to make post.thumbnailUrl to hold the image url that I want to add to the the post.
My blog . You'll see there are only the posts with out the thumbnails.
Thanks
Upvotes: 1
Views: 330
Reputation: 2673
Latter figured out that post.thumbnailUrl takes the first image appears in the post if it fits required image size. With the first template I used it didn't work out well. After choosing a different template the problem was solved.
Upvotes: 1
Reputation: 2673
I used a simple js script to do this.
var t2 = " <data:post.title/> ";
if(t2== " COD Server Setup "){
var e = "https://lh4.googleusercontent.com/-PIcMPlHmFt4/UlkBYbUzOtI/AAAAAAAAAQE/6I26Y6aNnPM/w540-h390-no/CSESign.jpg";}
else if(t2== " Same thing "){
e = "https://lh4.googleusercontent.com/-162ZlFQDm1w/Ulj-NoFTknI/AAAAAAAAAPQ/NwTG2lHXROE/w180-h130-no/sample1.jpg";}
else if(t2== " Testing Post "){
e = "https://lh4.googleusercontent.com/-162ZlFQDm1w/Ulj-NoFTknI/AAAAAAAAAPQ/NwTG2lHXROE/w180-h130-no/sample1.jpg";}
else{
e = " ";
}
document.write(bp_thumbnail_resize( e,"<data:post.title/>"));
When using this I have to edit the code each time when a new post is added in order to add a thumbnail to the post.
Upvotes: 1