Jump to content

kristi-lynn

Circle Member
  • Posts

    15
  • Joined

  • Last visited

Reputation Activity

  1. Like
    kristi-lynn got a reaction from Beyondspace in How do I add the blog year to the Skye template?   
    I know this post is a little old, but since I just spent the time doing it, here's some code you can inject into the page header to add the year to the date output on Skye's blog listings. You'll want to add it to the "Page Header Code Injection" area (for the blog listing page, not on an individual blog post).
    <style type="text/css"> .day:after { content: ','; } </style> <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> window.onload = init; function init() { var $year = $('.dt-published').map(function() { return $(this).attr('datetime').substr(0,4); }).get(); $( '.date-wrapper' ).each( function ( i ) { $( this ).append( '<span class="year">' + $year[i] + '</span>'); }); } </script> Hopefully others get some benefit from it!
  2. Like
    kristi-lynn got a reaction from Beyondspace in How do I add the blog year to the Skye template?   
    good catch @paul2009
    The bigger problem is it only works onload, so it doesn't work for entries that are loaded with infinite scroll.. gotta rework it a bit anyways..
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.