Jump to content

Creatingspaces

Member
  • Posts

    2
  • Joined

  • Last visited

Posts posted by Creatingspaces

  1. Hey @bangank 36, I use the code above I wasn't sure if it should go in the code injection for header, footer or somewhere else. I put it in header but all my blog posts still say the date in this format: APR 15. I am trying to get the date in this format: April, 15, 2022. This is the code I put in the code injection header. Any help would be greatly appreciated. Thank you,

     

    the website URL right now is https://friendsofthechildrenofvnzla.squarespace.com/

     

    <!-- Fix inconsistent blog date format on Squarespace 7.1 template -->

    <!-- Squarespace Forum Update 06-11-2021 -->

    <script src="https://stevenlevithan.com/assets/misc/date.format.js"></script>

    <script>

        (function(){

            document.addEventListener('DOMContentLoaded', function() {

                const dateformat = "mmm dd, yyyy";

                const pubdates = document.querySelectorAll("time[datetime]:not([class*=event-time]), time[pubdate], time.blog-meta-item--date");

                pubdates.forEach(pubDate => {

                    let d = new Date(pubDate.getAttribute("datetime") || pubDate.innerText);

                    if (pubDate.classList.contains('blog-meta-item--date') ) {

                        d = new Date(document.querySelector('[itemprop="datePublished"]').getAttribute('content').split("T")[0]);

                    }

                    pubDate.innerHTML = d.format(dateformat);

                });

            });

        })();

    </script>

  2. I am having a similar issue for my blog pages, my header has a black gradient throughout the website which looks great with a photo but on the blog pages you cannot add a section of photo above so I am left with an ugly black gradient on a white page. Anybody know a custom code to make the header solid white for blog pages only? os I am open to other solutions. I do not want to make the blog pages black, if like to leave them while. 

    This is the website URL right now: https://friendsofthechildrenofvnzla.squarespace.com/

    Thank you in advance!

    Screen Shot 2022-08-24 at 11.34.09 AM.png

×
×
  • 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.