How can I display the month and year on Skye template blog date circle?
On the Tudor template (includes the Skye, Ready, Indigo and Foundry templates) the blog dates are shown in a circle above the post. By default, the day (as a number) and the month are shown. To change this to the month and year requires some JavaScript.
To achieve this effect:
Add the following to the Header Code Injection:
<script> /* Put the month values here (in any language) */ var month=new Array(12); month[0]="Jan"; month[1]="Feb"; month[2]="Mar"; month[3]="Apr"; month[4]="May"; month[5]="Jun"; month[6]="Jul"; month[7]="Aug"; month[8]="Sep"; month[9]="Oct"; month[10]="Nov"; month[11]="Dec"; Y.use('node', 'node-load', function(Y) { Y.on('domready', function() { Y.all('.dt-published.date-callout').each( function() { var pdate = new Date(this.getAttribute('datetime')); this.setHTML(month[pdate.getMonth()] + " " + pdate.getFullYear()); } ); }); // Y.on }); // Y.use </script>
If you need a customised solution for your website, you can book a developer to help you, for as little as 15 minutes, or as much as two days. Get in touch if youβd like some help.