Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Featured posts? #15

Closed
bittlingmayer opened this issue Oct 15, 2017 · 2 comments
Closed

Featured posts? #15

bittlingmayer opened this issue Oct 15, 2017 · 2 comments

Comments

@bittlingmayer
Copy link

This is an excellent clean mobile-first theme, thanks again.

Ideally one could keep some posts from showing up on the front page.

For our purposes, it would be fine if that were possible by marking only the posts that should be hidden, or by marking all the posts that should be featured.

Is this currently doable with this theme, or can you point me in the right direction?

@daanbeverdam
Copy link
Owner

Hi @bittlingmayer,

If you want posts to not show up on the homepage, you can make them static from the ghost backend. This would be the easiest way. Another way would be to hide (non-)featured posts with your own custom css. You can do this by editing the theme files or adding your own <style> tag to the <head> from the backend.

@bittlingmayer
Copy link
Author

I ended up adding a home.hbs which shows only featured posts, which is similar to index.hbs, with the addition of {{#get "posts" filter="featured:true"}} and {{/get}}:

{{!< default}}
<div class="articles-wrapper">
    {{#get "posts" filter="featured:true"}}
        {{#foreach posts}}
    <div class="card-wrapper card-index {{post_class}}">
        {{> postcard}}
    </div>
        {{/foreach}}
    {{/get}}
    {{{pagination}}}
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants