Free Content Snippets

Free Content Snippets
Please add yours below to this collection of free, re-usable Content Snippets that you can copy and paste into your Ghost site. These are a useful built-in feature as explained here in the Ghost Docs:

You can also make re-usable snippets that automatically update across your entire site in every instance where they are used...

1. Paste this into your site's Footer Code Injection:

<script>
document.querySelectorAll('[data-ad-placeholder="ads-1"]').forEach((elem) => {
 elem.innerHTML = "... your ad html ...";
});
</script>

(making sure that any classes used within the "... your ad html ..." portion use single quotes, not double quotes.)

2. Paste this into an HTML card on a page:

<div data-ad-placeholder="ads-1"></div>

That way any time you want to update your content for that snippet (to apply to every instance all across your site) you can edit that snippet once in the Site Footer Code Injection from the admin area.


From:

Add Partial inside of content
So, to sum up . . . 1. Paste this into your site’s Footer Code Injection: <script> document.querySelectorAll(‘[data-ad-placeholder=“ads-1″]’).forEach((elem) => { elem.innerHTML = ”... your ad html ...”; }); </script> (making sure any classes used within the ”... your ad html ...” portion us…