COLOCANDO O BLOG EM ESTILO REVISTA

quarta-feira, 30 de julho de 20140 comentários

Para quem gosta do blog em estilo revista é bem facinho fazer. Entenda que neste caso eu considerei as medidas do template Minima original, portanto se for necessário, aumente a largura. (onde está na cor verde)

Vá até o HTML do seu blog, procure pelo código:
]]></b:skin>



Não se esqueça de antes de começar salvar uma cópia de seu template, caso não dê certo, é só reinstalá-lo.


Agora cole depois dele o código abaixo.



<!-- Estilo revista-->
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<style>
.post {
width:188px;
height:330px;
margin: 8px 4px 3px 4px;
padding:2px 1px 2px 1px;
background: #fff;
border: 3px groove #ccc;
overflow:hidden;
float: left;
}
.post h3 {
font-size: 12px;
background: #ccc;
text-shadow: #ccc 1px 1px 1px;
font-weight:bold;
padding:10px 0;
height: 60px;
}
.post-body {
height: 190px;
overflow:hidden;
}
.post-body img {
width:100px;
height: 80px;
float: left;
overflow:hidden;
margin: 3px;
padding: 2px;
border: 1px solid;
}
.post-footer {
overflow:hidden;
margin: 10px 0 -1px 0;
padding: 10px 0 -2px 0;
background: #ccc;
}
.post-footer-line-2 {display: none;}
.post-footer-line-3 {display: none;}
.date-header {display: none;}
</style>
</b:if>
</b:if>
<!-- fim Estilo revista-->
<script type='text/javascript'>
var thumbnail_mode = &quot;float&quot; ;
summary_noimg = 450;
summary_img = 400;
img_thumb_height = 100;
img_thumb_width = 100;
</script>
<script type='text/javascript'>
//<![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 = summary_noimg;
if(img.length>=1) {
if(thumbnail_mode == "float") {
imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';
summ = summary_img;
} else {
imgtag = '<div style="padding:5px" align="center"><img style="max-width:'+img_thumb_width+'px; max-height:'+img_thumb_height+'px;" src="'+img[0].src+'" /></div>';
summ = summary_img;
}}var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;}
//]]>
</script>


Salve. Agora clique em "Expandir modelos de widget"

Procure por:

<b:includable id='nextprev'> 

Depois dele cole o seguinte código:

<div style='clear: both;'/>


Agora vamos colocar o código "Leia mais" para que fique certinho...



Agora procure por:

<div class='post-body entry-content'>
<data:post.body/>
 <div style='clear: both;'/> <!-- clear for photos floats -->
</div>

e substitua por este abaixo:

<div class='post-body entry-content'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
</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 style='clear: both;'/> <!-- clear for photos floats -->
</div>

Procure pelo seguinte código:

<div class='post-footer'>

Abaixo dele cole:

 <b:if cond='data:blog.pageType != &quot;item&quot;'>
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<span id='showlink'><a expr:href='data:post.url'>Leia Mais &#9658;</a></span>
</b:if></b:if>

Se o template que você usa for o Simple, aberto depois de julho de 2010, veja AQUI como implementar o hack
Compartilhe :

Postar um comentário

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Ajudinha Blog - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger