Adding Inline Share Buttons To The Casper Theme

I cannot figure out how to add AddThis inline share buttons below every post in Ghost. I have tried adding the code to my theme, but maybe I am putting in the wrong place? I tried putting it in the post.hbs file?

Or should it go in the default.hbs file?

post.hbs should be the correct place to add anything you want to show up on every post. I would probably try adding some random text to different spots in the template file to try and see if it gives you any additional info on why you’re not seeing what you’ve added already.

Are you developing your theme locally?

I am using a text editor notepad ++ to edit my theme

I meant do you have ghost deployed on your local computer as in this tutorial:
Local Deployment
It makes doing small changes to themes and tweaking a lot easier if you’re doing it locally instead of uploading to your site every time.

I am uploading to my site everytime

Out of curiosity have you made any updates to your theme before this and had them show up correctly?

If not I would maybe try adding some random text in an obvious place to your home/index page, then try editing the package.json file and set the name field to something different before uploading the theme. Then it should show up as a separate theme in your admin panel and you’ll be able to explicitly activate it so you’ll know it’s hitting the right thing. Then if you don’t see that random text on your home page, there’s something weird going on.

Yes I have edited it before and it worked. I made the subscribe form at the bottom of the post always render. And it’s working fine

Maybe share the code you’re trying to add?
Is it just html or is there css that’s supposed to go along with it too?

Post the code in your post.hbs below the {{content}} helper.
That way your share button gets rendered after your content.
If you have Members Feature enabled, then post it below the closing {{/if}} statement.

May i ask which theme you use?

1 Like

I got it fixed thanks guys

1 Like