Ghost is a popular Content Management System that is used to make and manage blogs. This CMS is very easy to use, looks good, and it's perfect for people who want to focus on publishing content on their blog websites. But Ghost is missing the ability to add Facebook comments to your posts. Don't worry today we'll show you how to add Facebook comments to Ghost CMS in this blog post.
Add Facebook comments to Ghost
If you have a strong Facebook group, it could be helpful to use Facebook comments on your Ghost pages and posts. This will be helped you to keep all conversations in one place. The official Facebook Comments plugin can help you attain this.
Configure the Facebook comment plugin
To configure the Facebook comment plugin, visit the Facebook comment configurator and provide the information properly-
-
Your blog URL, where you want to add comments.
-
Comment desired width (either '100%' or a pixel value).
-
And the initial number of comments to display.
Clicking the Get Code button, you'll receive two sections of code. The first one is the JavaScript SDK, which will look like this snippet:
Add SDK and Plugin Code to your Ghost Blog
To install the Facebook Comments plugin, carefully copy the SDK code and paste it immediately after the opening <body>
tag in the default.hbs file.
Subsequently, copy the HTML code and place it wherever you desire the plugin to display on your page, typically in post.hbs between the opening {{#post}}
and closing {{/post}}
helper.
Show Comment count
By implementing the fb:comments-count value, you can exhibit the comment count on a specific URL within a <
span>
element on your webpage. You can use CSS to make the <span>
element look consistent with your website design.
To display the comment count, use the code.
<span class="fb-comments-count" data-href="https://example.com/"></span>
You can also add text after the code snippet, such as "thanks for your comments," to encourage engagement.
Comment Moderation
For comment moderation, you must connect either a Facebook account or app to your comments plugin implementation. To assign a Facebook account as the admin, insert the following meta element in the <head>
section of the default.hbs file:
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID}"/>
To add multiple moderators, add more than one element, each with one Facebook ID:
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID_1}"/>
<meta property="fb:admins" content="{YOUR_FACEBOOK_USER_ID_2}"/>
Restart Ghost.
After completing any changes or modifications, it is recommended to restart the Ghost instance to ensure that all modifications have taken effect. You can restart Ghost by using the command "ghost restart" in the terminal or by restarting the Ghost process in the server manager.
To Sum Up
In conclusion, integrating Facebook comments into Ghost CMS is a simple and straightforward approach that can boost user engagement and promote a sense of community. You may quickly set up and insert the code snippet, showcase the comment count, and control comments by following the instructions given in this blog. You may also read- How to add Disqus comments with ghost cms.