Jump to content

Blog Post Excerpt Glitch

Recommended Posts

Site URL: https://www.rendyreviews.com/movie-reviews

Hi I at the beginning of my posts I keep getting this glitch with my reviews whenever i post them.

1465255422_ScreenShot2021-06-16at11_15_23PM.thumb.jpg.e5bf73fa1e5891ccd28a99cde4ea9413.jpg.851275449317621c84cefe0cfbf92141.jpgThis is the code I'm working with:



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

    var element = document.querySelector('.BlogItem-title');

  if (!element) {



    var newElement = document.createElement('h3');

    newElement.style.order = 1;

    newElement.className = "BlogItem-excerpt";

    newElement.innerHTML = document.querySelector('[property="og:description"]').getAttribute("content");

    var elementParent = element.parentNode;


    elementParent.insertBefore(newElement, element.nextSibling);




It works at times, it doubles up most of the time.

Can somebody help fix this for me? Thank you so much.

Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

On 1/14/2022 at 2:13 AM, Rendy said:



I disabled the code for a bit but here its all over again.

It looks fine to me


Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

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