My URL is https://thinkbubbles.ghost.io/ - and I’m an absolute beginner, on day 2 of my Ghost Pro free trial. I’ve installed the Lyra theme, and added a couple of posts - however, I want to pin my introductory post to the top of the home page.
I’ve found various suggested solutions online, which all seem to assume self-hosting - and advise inserting some code into the index.hbs or home.hbs files in your theme and then re-starting Ghost.
Should I do this offline, using the Lyra files I downloaded from Github - and then re-upload the Lyra theme to Ghost? Is that what I’m supposed to do?
<div class="post-feed">
{{> "pinned"}} {{!-- Pinned post Partial we just created - partials/pinned.hbs --}}
{{#foreach posts visibility="all"}}
{{!-- The tag below includes the markup for each post - partials/post-card.hbs --}}
{{> "post-card"}}
{{/foreach}}
</div>
now create your introductory post & mark that as feature post from ghost admin & that post will show up on top of all articles
Unfortunately, I’m still having problems. I’ve added a new post - and despite the fact that I’ve not “featured” it, it now appears at the top of my home page, rather than my ‘featured’ introductory article.
I am using a modification of the Casper theme, and when I incorporate your solution using pinned.hbs, I get the featured post duplicated on index.hbs because it is not excluded from the {{#foreach}} loop. Both pinned.hbs and index.hbs are copied to my theme as shown in this forum entry. How do I exclude the post that is featured from the foreach loop executed after pinned.hbs is inserted?
I got the same result just creating and using an internal tag of “pinned” so I went back to filter=“featured:true” in pinned.hbs and in index.hbs I wrapped the {{> “post-card”}} in the {{#unless featured}} {{/unless}} to prevent duplicating the featured post. Just be sure to turn on the checkbox for “Feature this post” in the post settings for the post you want to be featured.
Change filter=“tag:hash-pinned” to filter=“featured:true” in the first line of pinned.hbs, and then check the “Feature this post” item in the Post Settings for the post you want to be featured (access the Settings by clicking on the gear symbol in the upper right when editing the post). As to the duplicated posts underneath authors, I don’t include that in my index.hbs so I haven’t worked with that code other than to comment it out if it is in the Casper theme.
This seems like it worked however it is only pinning one article. I changed limit="1" to limit="2" (and of course selected each article as Featured) but it did not change.
Also, I reverted my index.hbs back to how it was originally. Does that seem right?