Books

New Release from Alexa Verde plus Wednesday’s Free and Sale Books

ul.body {
margin: 0;
text-align: center;
}
ul.body li {
list-style: none !important;
display: inline-block;
}
@media screen and (min-width:768px) {
ul.body img {
width: 15%;
margin: 0 2.5% 35px;
}
}
@media screen and (max-width:767px) {
ul.body img {
width: 45%;
margin: 0 2.5% 25px;
}
}

//If it’s code-free, leave true — if not, set false
var codeFree = false;

var serial = [];

serial.push(“B074RWYM9W”); //1
serial.push(“B073SHS8WZ”);

var imageLinkPart1 = “https://images.weserv.nl/?url=images.amazon.com/images/P/”;
var imageLinkPart2 = “.02._SCLZZZZZZZ_jpg”;
var buttonLinkPart1 = “https://www.amazon.com/gp/product/”;
var linkPart2 = “/ref=as_li_ss_il?ie=UTF8&linkCode=as2&camp=1789&creative=390957&creativeASIN=”;
var linkPart3 = “&tag=tholstwa-20”;

//This is finding the right blog posts ‘body’ tag. It just looks for one that hasn’t been populated yet.
//This is because there will be multiple blog posts on the page
var parents = document.getElementsByClassName(“body”);

var parent = null;

for (p = 0; p < parents.length; p++) { console.log(parents[p].childNodes.length); if (parents[p].childNodes.length < 2) { parent = parents[p]; break; } } //Creates a li for each book, and adds it to the found tag for (i = 0; i < serial.length; i++) { var li = document.createElement("li"); parent.appendChild(li); var imgHref = document.createElement("a"); imgHref.setAttribute("target", "_blank"); if (codeFree) { imgHref.setAttribute("href", buttonLinkPart1 + serial[i] + linkPart2 + serial[i]); } else { imgHref.setAttribute("href", buttonLinkPart1 + serial[i] + linkPart2 + serial[i] + linkPart3); } var imgA = document.createElement("img"); imgA.setAttribute("src", imageLinkPart1 + serial[i] + imageLinkPart2); imgA.setAttribute("height", "200"); imgA.setAttribute("width", "133"); imgHref.appendChild(imgA); parent.appendChild(imgHref); } ul.body { margin: 0; text-align: center; } ul.body li { list-style: none !important; display: inline-block; } @media screen and (min-width:768px) { ul.body img { width: 15%; margin: 0 2.5% 35px; } } @media screen and (max-width:767px) { ul.body img { width: 45%; margin: 0 2.5% 25px; } } //If it's code-free, leave true -- if not, set false var codeFree = false; var serial = []; serial.push("B07MY7FPW7"); //1 serial.push("B002PMV4WY"); serial.push("B002PMV4T2"); serial.push("B00K8BGEOW"); serial.push("B00RYB9NJW"); serial.push("B002LUYTWC"); serial.push("B005MJ8OMU"); serial.push("B01EBNW67G"); //8 serial.push("B01N5Y68DA"); serial.push("B00IWW57GU"); serial.push("0000000000"); serial.push("0000000000"); serial.push("0000000000"); serial.push("0000000000"); serial.push("0000000000"); serial.push("0000000000"); //16 var imageLinkPart1 = "https://images.weserv.nl/?url=images.amazon.com/images/P/"; var imageLinkPart2 = ".02._SCLZZZZZZZ_jpg"; var buttonLinkPart1 = "https://www.amazon.com/gp/product/"; var linkPart2 = "/ref=as_li_ss_il?ie=UTF8&linkCode=as2&camp=1789&creative=390957&creativeASIN="; var linkPart3 = "&tag=tholstwa-20"; //This is finding the right blog posts 'body' tag. It just looks for one that hasn't been populated yet. //This is because there will be multiple blog posts on the page var parents = document.getElementsByClassName("body"); var parent = null; for (p = 0; p < parents.length; p++) { console.log(parents[p].childNodes.length); if (parents[p].childNodes.length < 2) { parent = parents[p]; break; } } //Creates a li for each book, and adds it to the found tag for (i = 0; i < serial.length; i++) { var li = document.createElement("li"); parent.appendChild(li); var imgHref = document.createElement("a"); imgHref.setAttribute("target", "_blank"); if (codeFree) { imgHref.setAttribute("href", buttonLinkPart1 + serial[i] + linkPart2 + serial[i]); } else { imgHref.setAttribute("href", buttonLinkPart1 + serial[i] + linkPart2 + serial[i] + linkPart3); } var imgA = document.createElement("img"); imgA.setAttribute("src", imageLinkPart1 + serial[i] + imageLinkPart2); imgA.setAttribute("height", "200"); imgA.setAttribute("width", "133"); imgHref.appendChild(imgA); parent.appendChild(imgHref); }