Jump to content

Using Post Blog Item Code Injection to add Newsletter blocks to every blog post in a blog.

Recommended Posts

Hi there! I'm transitioning my site from 7.0 to 7.1 manually and have just learned about the new Post Blog Item Code Injection option in the settings of a Blog. I've used code injection in other areas for other reasons and would like to put this to use to add a newsletter sign ups to the bottom of every Blog Post included in this blog. Has anyone done this and would they be willing to share the code they used? Thank you so much!

Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

1 hour ago, LizRussell said:

Hi there! I'm transitioning my site from 7.0 to 7.1 manually and have just learned about the new Post Blog Item Code Injection option in the settings of a Blog. I've used code injection in other areas for other reasons and would like to put this to use to add a newsletter sign ups to the bottom of every Blog Post included in this blog. Has anyone done this and would they be willing to share the code they used? Thank you so much!

You can add your code on Home > Settings > Advanced > Code injection to run the code on all pages

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
  • 2 weeks later...
14 hours ago, sberens said:

The question is what is the code...

My idea is adding newsletters to footer and using some code to only show this block on blog page

Edited by bangank36

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment
On 9/8/2022 at 8:00 PM, LizRussell said:

Hi there! I'm transitioning my site from 7.0 to 7.1 manually and have just learned about the new Post Blog Item Code Injection option in the settings of a Blog. I've used code injection in other areas for other reasons and would like to put this to use to add a newsletter sign ups to the bottom of every Blog Post included in this blog. Has anyone done this and would they be willing to share the code they used? Thank you so much!

You can use approach @ bangank36 posted above. You can add it first, then we can move it from footer to blog post

or you can use a 3rd party plugin (I used plugin to solve similar case. Our approach is add a new page on Not Linked > Add Newsletter Block > Then use plugin to make it appear on Blog Post Only > Then use code to move Newsletter position). If you are interested this option, I will give the plugin link.

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.