IdTaylor Posted March 15 Share Posted March 15 Hello! I am creating a paywall for a blog on my squarespace 7.1 site and have the business plan. When someone see's the preview of the blog, they see the Title, meta content, and excerpt. Is there a way to also include the featured image in the paywalled blogs preview content? I have already got the featured image to show at the top of blogs using the following in "blog item code injection": <style> div.blog-item-image-wrapper { margin-bottom:12px; } img.blog-item-image { width:100%; } </style> <script> const i = document.querySelector('meta[itemprop="image"]'); const u = !!i ? i.getAttribute('content') : ''; if (u) { const c1 = document.querySelector('.blog-item-inner-wrapper'); const c2 = document.querySelector('.blog-item-top-wrapper'); const ed = document.createElement('div'); ed.setAttribute('class','blog-item-image-wrapper'); const ei = document.createElement('img'); ei.setAttribute('class','blog-item-image'); ei.setAttribute('src',u); ed.appendChild(ei); c1.insertBefore(ed,c2); } </script> Thank you Link to comment
tuanphan Posted March 18 Share Posted March 18 I don't know this code, but if you add an image block to top of post, I can give you code to move Title/Date under this Image Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
IdTaylor Posted March 19 Author Share Posted March 19 Amazing thank you! I've removed that code and added an image block to the top of the post. Please could you share the code to move this block above the title and date? Thank you so much Link to comment
tuanphan Posted March 21 Share Posted March 21 On 3/19/2024 at 8:18 PM, IdTaylor said: Amazing thank you! I've removed that code and added an image block to the top of the post. Please could you share the code to move this block above the title and date? Thank you so much I forgot ask blog url. Can you share it? Or you can follow this guide, I just wrote Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment