Adding a banner to advertise my website on my Ghost newsletter site

Hello,

Is there any way I can add a banner (which will look like a banner) to advertise another website of mine?

Thanks,

Alex

The answer to this question is very theme specific. Link your site?

www.notjustadz.com I am using the source theme. Thanks!!

Something like this:

<script>
const header=document.querySelector('header');
let newDiv = document.createElement('div')
newDiv.innerHTML = "<p>Hello world! Put any HTML wanted here</p>"
'<p>Hello world! Put any HTML wanted here</p>'
//header.appendChild(newDiv); alternative - depends where you want it!
header.prepend(newDiv)
</script>

For a banner above source, you’ll also need to tweak margins (depending on the banner height):

<style>
.gh-header.is-classic.has-image {
margin-top: 80px;
}
</style>

The javascript needs to go in the code injection footer, but the styles can go in the code injection header.
1 Like