Source theme, Search header style, and Featured posts

Regarding the latest Source theme (on Ghost Pro) configured with the Search header style: Does it support featured posts?

There is no “Show featured posts” switch for this header style, so I presume that featured posts are not supported. But I swear I was playing with it earlier today, set a few posts to “Featured”, and a Featured section appeared just above “Latest” with those posts.

Of course I can’t seem to reproduce that behavior now.

In any case, I just want to confirm what the expected behavior is.

Update 3/3: The Featured section just appeared again. I did not make any changes. I wasn’t even logged into the console. I grabbed a screenshot.

(Since I’m waiting for my tests to run anyway…) Looking at the code for Source. You can follow along here: GitHub - TryGhost/Source: The default theme for Ghost

Starting with home.hbs

{{#match @custom.header_style "!=" "Highlight"}}
    {{> "components/featured" showFeatured=@custom.show_featured_posts limit=4}}
{{/match}}

So… if you aren’t set to highlight, this component should be called.

Let’s check the component (in partials/compontents/featured.hbs)

{{#if showFeatured}}
    {{#get "posts" filter="featured:true" include="authors" limit=limit as |featured|}}
        <section class="gh-featured gh-outer">
            <div class="gh-featured-inner gh-inner">
                <h2 class="gh-featured-title">Featured</h2>
                <div class="gh-featured-feed">
                    {{#foreach featured}}
                        {{> "post-card" imageSizes="80px"}}
                    {{/foreach}}
                </div>
            </div>
        </section>
    {{/get}}
{{/if}}

Nothing weird appears to be going on. Are you sure that you have posts that are published and marked featured (slider on the right side menu)? Confirm you aren’t set to highlight?

Confirmed that 1) header style is set to Search, and that 2) no posts (0) are set to featured.

Right now it is displaying an empty Featured section per my screen shot. Yesterday it wasn’t.

Unfortunately my knowledge of HTML/CSS is very limited (though if you find yourself developing a file system or DB storage engine in C I’ve got your back :grinning: ).

There’s a slider to not show a featured section. It’s in the theme settings (/ghost > settings (gear icon) > design & branding > (customize link) > click the theme tab on the right side of the preview image.

Can be done with CSS, but I’d just throw the slider and be done with it. :)

(You could also file a bug against the Source theme, which would go in the themes monorepo, since it really shouldn’t show a featured header if there are no featured posts.)

The presence of the featured slider depends on what you select for header style.

Highlight, Magazine: slider is present
Landing, Search, Off: slider is NOT present

That’s why I am surprised to see an empty Featured section with header style set to Search.

Interesting: I set header style to Off. Saved. Set header style back to Search. Saved. And (for now) the empty Featured section is gone.

Seems like a bug, so I filed this report: Empty Featured section with Source theme and Search header style

2 Likes