On my main page I have a slideshow with the featured posts however, when I try to enter one of them I go to /undefined instead of the link I'm suppose to.
Any idea why?
// Featured posts
cat1 = 'zblog';
imgr = new Array();
imgr[0] = "http://sites.google.com/site/fdblogsite/Home/nothumbnail.gif";
showRandomImg = true;
aBold = true;
numposts1 = 12;
function recentposts1(json) {
j = showRandomImg ? Math.floor((imgr.length + 1) * Math.random()) : 0;
img = new Array;
if (numposts1 <= json.feed.entry.length) maxpost = numposts1;
else maxpost = json.feed.entry.length;
document.write('<div class="blog_featured_posts owl_carouselle" style="display:none;">');
for (var i = 0; i < maxpost; i++) {
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var tag = entry.category[0].term;
var posturl;
if ("content" in entry) var postcontent = entry.content.$t;
else if ("summary" in entry) var postcontent = entry.summary.$t;
else var postcontent = "";
if (j > imgr.length - 1) j = 0;
img[i] = imgr[j];
s = postcontent;
a = s.indexOf("<img");
b = s.indexOf('src="', a);
c = s.indexOf('"', b + 5);
d = s.substr(b + 5, c - b - 5);
if (a != -1 && (b != -1 && (c != -1 && d != ""))) img[i] = d;
var trtd = '<div class="blog_featured_post"><a href="' + posturl + '"><div class="blog_contents"><h3>' + posttitle + '</h3> <div class="clr"></div><span>' + tag + '</span></div><div class="feat-img" style="background-image:url(' + img[i] + ');"></div></a></div>';
document.write(trtd)
j++
}
document.write('</div>')
};