How do I modify my Ghost theme to show Contextly recommendations?

This is the final step needed to enable Contextly on Ghost, after you have connected your Ghost site to Contextly by API and added Header and Footer scripts.

To modify your theme (video below the explanation):

1. In Ghost, go to the Gear Icon again (bottom left)

2. Click Theme

3. Look for the theme that is marked (Active) and download it

4. This downloads a zip file. Click the file to expand it into a folder.markuphero-0bAcdgvegUSLDtvgwGMB-1.png
5. Open a text editor . Then in the editor, choose to open a file, navigate to the folder Partials and open the file content.hbs (trying to open a .hbs file from the directory directly won't likely work unless you are a developer used to working with such files)
6. Insert this code on a new line right below {{content}}. This tells Contextly where to display the recommendations at the end of a post. We recommend showing recommendations before comments.

{{#is "post"}}
<span class="ctx-article-root"><!-- --></span>
<div class="ctx-module-container ctx-clearfix"></div>

7. Save the file.
8. Re-zip or Compress the Theme folder (usually an option if you right-click the folder). Name the zip file something slightly different.
9. Go back to Ghost in the Themes page. Upload the theme and make it active.

markuphero-gVfm4ZVul8TGdlBJLS5Y-1.png10. Contextly recommendations should start showing immediately (if your site has posts). Check this by going to a post page.



If you run into any issues or this looks too complicated, please first try steps 1-3 to download the zip file. Upload that to Dropbox, Google Drive, etc so you can get a shareable link. Then email us at with an explanation and a link to your theme that we can edit for you.

We try to do this as quickly as possible, but depending on the time/day, it might take us a little time to get to it.

Have more questions? Submit a request