To save this script into our layout is quite easy. First, open your edit HTML template and do not forget to check "Expand Widget Templates" and than search first html code to date. (Ctrl + F)
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
And the final step, replace HTML code above with the following code.
<b:if cond='data:post.dateHeader'>
<script>var ultimaFecha = '<data:post.dateHeader/>';</script>
<h2 class='date-header'><data:post.dateHeader/></h2>
<b:else/>
<h2 class='date-header'>
<script>document.write(ultimaFecha);</script>
</h2>
</b:if>
<script>var ultimaFecha = '<data:post.dateHeader/>';</script>
<h2 class='date-header'><data:post.dateHeader/></h2>
<b:else/>
<h2 class='date-header'>
<script>document.write(ultimaFecha);</script>
</h2>
</b:if>
Enjoy and happy blogging.
Post a Comment