Creatingspaces
-
Posts
2 -
Joined
-
Last visited
Content Type
Forums
Gallery
Blogs
Events
Store
Downloads
Profiles
Posts posted by Creatingspaces
-
-
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!
[FreeShare] Date display format options on all pages
in Customize with code
Posted
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>