Friday, March 7, 2014

November 13, 2012 Curabitur id auctor stamp collecting nibh tellus adipiscing pharetra. Fusce orci


In this article we are 2 ways to personalize dates with CSS3 and Javascript, because some time ago we saw a way to do it and some users have had trouble embedding the script correctly in your templates and remained an empty container, did not run function properly or had a problem with the label used. To avoid this problem, I created two scripts, if the first failed in their templates, they may have recourse to the second.
First Method: Using data: post.dateHeader: The <data:post.dateHeader /> tag is what is responsible for displaying the date in your blog entries, generally should work on any template, but as every rule has an exception, there are some who refuse to work with this label. To operate this method, first locate the following line in your template (with the gadgets expanded): Top of This <data.post.body/> paste the following code: <script type="text/javascript"> / / Script created by Victor Calderon To Help Bloggers - Option to data: post.dateHeader dividir_fecha function () {var fecha_completa = "<data:post.dateHeader/>" / / Original Format nueva_fecha var date = fecha_completa.split ("" ) / / Split to split var day = nueva_fecha [0];. nueva_fecha month = [1], year = nueva_fecha [2]; document.write ("<span class=\"dia\">" + day + "</ span>" / / returns this month with up to 3 characters only + "<span class=\"mes\">" stamp collecting mes.slice + (0,3) + "</ span>" + "<span class = \ "year \"> "+ year +" </ span> ");} </ script> <div class="fecha-ayudabloggers"> <script> dividir_fecha () </ script> </ div> Later go to "Settings | Language and Format" and "Date Header Format" stamp collecting you set the following: November 13, 2012 If this does not work, delete the above code and try the following method. Second method: Using data: post.timestamp: The <data:post.timestamp/> label is one that shows the time in a particular section of the entry. To know when we can do nothing, but we can take advantage of the options found in paragraph format time:
You must choose the one that has this format: Tuesday, November 13, 2012 Once you select this option, the following script will stick in the same section as above: <script type="text/javascript"> / / Script created by Victor Calderon To Help Bloggers - Option to data: post.timestamp dividir_fecha function () {var fecha_completa = "<data:post.timestamp/>" / / Original Format fecha_completa.split nueva_fecha = (",") var date; / / Split to split var var month = nueva_fecha [1],. nueva_fecha var year = [2] = var dia_nuevo mes.split ("") / / The day and month are together, in order to obtain only the day this fix is required dia_nuevo var day = [2]; document.write ("<span class=\"dia\">" + day + "</ span>" / / Returns this + "<span class = \" month \ ">" + mes.slice (1,4) + "</ stamp collecting span>" + "<span class=\"año\">" año.slice + (1,5) + "</ span>" . / / The slice is to eliminate the space and for the month to limit to 3 characters);} </ script> stamp collecting <div stamp collecting <script> class="fecha-ayudabloggers"> dividir_fecha () </ script> </ div> Previsualizamos us if the date appears correctly in each post, and if successful can save the template. Note: If a syntax error when trying to preview or save the template must parse the code at the end of the script (All document.write section) appears. Customizing Dates: The result of both scripts is: <div class="fecha-ayudabloggers"> <span class="dia"> 13 </ span> <span class="mes"> November </ span> < span class = "year"> 2012 </ span> </ div> If we previsualizamos, see the following stamp collecting result:
November 13, 2012 To apply attributes selectors will use the already established classes, both <div>, as subelements. Ayudabloggers-date {/ * Attributes container date * /} day {/ * attributes. day * /}. {month / Month * Attributes * /}. year {/ * Attributes of the year * /} You can play with the margins, different font sizes, flotation and all the attributes you deem necessary. So you can get an idea of what you can do, Attachment 2 with their respective attributes stamp collecting examples: Example 1 (Based on: WpLover - Easier Date Display Technique with CSS3):
November 13, 2012 Curabitur id auctor stamp collecting nibh tellus adipiscing pharetra. Fusce orci vel non semper just feugiat. Cras eu leo at purus tristique ultrices. Duis autem vel eum iriure pain in vulputate velit esse hendrerit in molestie consequat, vel illum dolore eu nulla facilisis at vero eros feugiat accumsan et qui et iusto hate dignissim blandit PRAESENT luptatum zzril delenit augue

No comments:

Post a Comment