How to convert Blogger template to Magazine style with Post summaries and Thumbnails

Many times i thought of applying blogger default template to my blog but was not satisfies by the design offered by the templates so i always switched to other templates that are available for free download.. But soon i realized that it’s not a good idea to use those templates as they are not so easy to customize to match our need and are being used by other bloggers at the same time too.. Therefore my blog template will not be unique.,sooner or later you will understand this..

convert blogger template to magazine style

But soon i decided to stick to the template offered by blogger only and customizing them according to my needs..
In this article i will explain you how you can summaries your posts in the home page of your blog to make it look like Magazine or tech blog so to make it look more attractive.
The magazine or newspaper style layout for blogger post are those that displays the post summary with a thumbnail on the homepage .
However there are many ways to achieve this but i am listing the most efficient way to do it!
The tutorial is complied in very easy to understand way and i hope you will love it!
So lets get started,

Step 1.

Login to your blogger dashboard and firstly backup your existing template to make sure that you don’t loose anything important,now got to templates and click on Edit Html button:
Backup template

 

Step 2.

Click anywhere inside the code area and search below code by pressing CTRL+F keys of your keyword.

<data:post.body/><br><br>

 

Note: You may find the above code more than once ,but you have to stop at the second one in order to see the effect.

Step 3.

Replace the above line of code with the code given below:

<b:if cond='data:blog.pageType != &quot;item&quot;'><br><br><b:if cond='data:blog.pageType != &quot;static_page&quot;'><br><br>&nbsp;<span class='post-comment-link'><b:if cond='data:blog.pageType != &quot;item&quot;'><b:if cond='data:post.allowComments'><a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:post.numComments/></a></b:if></b:if></span><br><br><div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div><br><br>&nbsp; <script>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script><br><br><span class='readmorebutton' style='float:right'><a expr:href='data:post.url'>Read More &#187;</a></span></b:if></b:if><br><br><b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></b:if><br><br><b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>
Note:You can replace the Read More &#187 text in the line 11 with anything you want..like continue reading or know more etc etc

Step 4.

Now again place CTRL+F to find the below line:

<b:include data='post' name='post'/>

Step 5.

Replace the above line as well and instead add this:

<b:include data='post' name='post'/>

<b:if cond='data:post.isFirstPost'>

<b:if cond='data:blog.homepageUrl == data:blog.url'>

<div id='first'>

<b:if cond='data:post.title'>

<h3 class='post-title entry-title'>

<b:if cond='data:post.link'>

<a expr:href='data:post.link'><data:post.title/></a>

<b:else/>

<b:if cond='data:post.url'>

<a expr:href='data:post.url'><data:post.title/></a>

<b:else/>

<data:post.title/>

</b:if>

</b:if>

</h3>

</b:if>

<div class='first-body'>

<b:if cond='data:blog.pageType != &quot;item&quot;'>

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<div expr:id='&quot;summary1&quot; + data:post.id'><data:post.body/></div>

  <script>createSummaryAndThumb1(&quot;summary1<data:post.id/>&quot;);</script>

<span class='post-comment-link'><b:if cond='data:blog.pageType != &quot;item&quot;'><b:if cond='data:post.allowComments'><a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><data:post.numComments/></a></b:if></b:if></span>

<span class='readmorebutton' style='float:right'><a expr:href='data:post.url'>Read More &#187;</a></span>

</b:if></b:if>

<b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></b:if>

<b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>

</div>

</div>

<b:else/>

<b:include data='post' name='post'/>

</b:if>

<b:else/>

<b:include data='post' name='post'/>

</b:if>
 
Note:You can replace the Read More &#187 text in line 47 with anything you want..like continue reading or know more etc etc
 
Step 6.

Now you have to find </head> tag and paste the given script before </head>:

script>

posts_no_thumb_sum = 290;

posts_thumb_sum = 240;

img_thumb_height = 80;

img_thumb_width = 80;

first_no_thumb_sum = 580;

first_thumb_sum = 450;

img_thumb_height1 = 145;

img_thumb_width1 = 165;

</script>


<script>

//<![CDATA[

function removeHtmlTag(strx,chop){

if(strx.indexOf("<")!=-1)

{

var s = strx.split("<");

for(var i=0;i<s.length;i++){

if(s[i].indexOf(">")!=-1){

s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);

}

}

strx = s.join("");

}

chop = (chop < strx.length-1) ? chop : strx.length-2;

while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;

strx = strx.substring(0,chop-1);

return strx+'...';

}


function createSummaryAndThumb(pID){

var div = document.getElementById(pID);

var imgtag = "";

var img = div.getElementsByTagName("img");

var summ = posts_no_thumb_sum;

if(img.length>=1) {

imgtag = '<span class="posts-thumb" style="float:left;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';

summ = posts_thumb_sum;

}


var summary = imgtag + '<div class="summary">' + removeHtmlTag(div.innerHTML,summ) + '</div>';

div.innerHTML = summary;

}


function createSummaryAndThumb1(pID){

var div = document.getElementById(pID);

var imgtag = "";

var img = div.getElementsByTagName("img");

var summ = first_no_thumb_sum;

if(img.length>=1) {

imgtag = '<span class="first-post-thumb" style="float:left;"><img src="'+img[0].src+'" width="'+img_thumb_width1+'px" height="'+img_thumb_height1+'px"/></span>';

summ = first_thumb_sum;

}


var summary1 = imgtag + '<div class="summary">' + removeHtmlTag(div.innerHTML,summ) + '</div>';

div.innerHTML = summary1;

}


//]]>

</script>
Note:You can replace the Read More &#187 text in line 47 with anything you want..like continue reading or know more etc etc

Step 6.

Now you have to find </head> tag and paste the given script before </head>:

script>

posts_no_thumb_sum = 290;

posts_thumb_sum = 240;

img_thumb_height = 80;

img_thumb_width = 80;

first_no_thumb_sum = 580;

first_thumb_sum = 450;

img_thumb_height1 = 145;

img_thumb_width1 = 165;

</script>


<script>

//<![CDATA[

function removeHtmlTag(strx,chop){

if(strx.indexOf("<")!=-1)

{

var s = strx.split("<");

for(var i=0;i<s.length;i++){

if(s[i].indexOf(">")!=-1){

s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);

}

}

strx = s.join("");

}

chop = (chop < strx.length-1) ? chop : strx.length-2;

while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;

strx = strx.substring(0,chop-1);

return strx+'...';

}


function createSummaryAndThumb(pID){

var div = document.getElementById(pID);

var imgtag = "";

var img = div.getElementsByTagName("img");

var summ = posts_no_thumb_sum;

if(img.length>=1) {

imgtag = '<span class="posts-thumb" style="float:left;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';

summ = posts_thumb_sum;

}


var summary = imgtag + '<div class="summary">' + removeHtmlTag(div.innerHTML,summ) + '</div>';

div.innerHTML = summary;

}


function createSummaryAndThumb1(pID){

var div = document.getElementById(pID);

var imgtag = "";

var img = div.getElementsByTagName("img");

var summ = first_no_thumb_sum;

if(img.length>=1) {

imgtag = '<span class="first-post-thumb" style="float:left;"><img src="'+img[0].src+'" width="'+img_thumb_width1+'px" height="'+img_thumb_height1+'px"/></span>';

summ = first_thumb_sum;

}


var summary1 = imgtag + '<div class="summary">' + removeHtmlTag(div.innerHTML,summ) + '</div>';

div.innerHTML = summary1;

}


//]]>

</script>

Step 7.

Below the above script paste the given CSS style

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<b:if cond='data:blog.pageType != &quot;item&quot;'>

<style>

.first-post-thumb {

    margin-right: 10px;

}


.summary {

    height: 100%;

}


#first { /* Styles for the First Post Container */

    width: auto;

    height: 250px;

    float: left;

    margin-bottom: 10px;

    background-color: #F4F4F4; /* background color for the first post */

    border: 1px solid #E5E5E5; /* border for the first post */}


.first-body { /* Style for the First Post summary */

    color: #545454;

    font-size: 13px;

    text-align: justify;

    padding: 5px 10px;

    line-height: 1.5em;

}


#first h3 a, #first h3 a:visited { /* Style for the First Post Title*/

    border-bottom: 2px solid #DFDFDF;

    color: #515151;

    font-size: 20px;

    display: block;

    margin: 10px auto;

    width: 95%;

    font-size: 20px;

    padding: 0px 0px 4px 0px;

    font-weight: bold;

    text-align: left;

    line-height: 1.4em;

    background: none;

}


#first h3 a:hover { /* Color on mouseover for the First Post Title */

    color: #1061A1;

}


.post { /* Styles for the small posts container */

    float: left;

    margin: 0px 6px 2% 5px;

    width: 46%;

    height: 230px;

    padding: 0px 5px 5px 5px;

    background: #FCFCFC; /* background color for the small posts */

    border: 1px solid #E5E5E5; /* border for the small posts */

    overflow: hidden;

}


.posts-thumb { /* Style for the small posts thumbnails */

    margin-right: 10px;

}


.post-body img, .post-body .tr-caption-container, .Profile img, .Image img, .BlogList .item-thumbnail img {

    background: none;

    border: none;

    box-shadow: none;

    padding: 0;

}



h3.post-title a{ /* Style for the small posts titles */

    font-size: 14px;

    color: #747474;

    text-transform: uppercase;

}


h2.date-header { /* Hide the post date */

    display: none;

}


.post-footer {

    display: none;

}


h3.post-title {

    margin: 0px;

}


.readmorebutton {

    margin-top: 5px;

}


.readmorebutton a { /* Styles for the Read More link */

    color: #767676;

    border: 1px solid #E1E1E1;

    background: #EAEAEA; /* Background color for the Read More link */

    text-decoration: none;

    padding: 3px 5px;

    font-weight: bold;

    font-size: 11px;

    float: right;

    position: relative;

}


.post-comment-link { /* Style for the comment bubble of posts below */

    position: absolute;

    top: -35px;

    right: -10px;

    display: block;

    border: 1px solid #E1E1E1; /* border for the comment bubble */

    background: #EAEAEA; /* background color for the comment bubble */

    font-size: 11px;

    position: absolute;

}


#first .post-comment-link { /* Style for the comment bubble of first post */

    position: absolute;

    top: 10px;

    right: 0px;

}


.post-comment-link a { /* Link color for the comments bubble*/

    padding: 10px;

    color: #6A6A6A;

    text-decoration: none;

    font-weight: bold;

}


#blog-pager {

    clear: both;

}

</style>

</b:if>

</b:if>
Now you are done!

Customizing the Magazine style to suit your needs

1) Remember to change the number of post that you wants to display on the homepage ,just simply going to settings>>>Posts and comments>>>Show at most and type how many posts you want to display.
Number of posts to display
2) See the Step 7 line 25 and line 27,change it to desired number inorder to change the width and height of the post container.
3) You can also change the number of character that you want to be displayed in the summary of the post Just change the values in step 6 line 3,5,7,9,11,13,15,17
posts_no_thumb_sum = 290;
posts_thumb_sum = 240;
img_thumb_height = 80;
img_thumb_width = 80;
first_no_thumb_sum = 580;
first_thumb_sum = 450;
img_thumb_height1 = 145;
img_thumb_width1 = 165;
  • Doing changes in line 3 will change the number of character in the summary when there will be no image or thumbnail.
  • Doing change in line 5 will change the number of character in the summary when there will be no image or thumbnail.
  • Line 7 will change the height of thumbnail.
  • Line 9 will change the width of the thumbnail.
  • Line 11,13,15,17 will reflect changes in the first thumbnail that is dispalyed
Recommended Reading:  Seven Mobile Marketing Strategies you should be using in 2016