I’m using the Ruby theme and all is going well until I categorize a post as Members-only. When I do that, the thumbnail changes dimension and the title and excerpt disappear for non-members. Page looks fine to people logged in.
You can see the issue here: https://volver.ca — the first image is elongated and missing any text. If you’re looking on a phone, the posts that come next format correctly. If you’re looking on a computer, all entries in the first row look wonky.
When I change the status to Public, it fixes itself.
Any way to fix this? Thank you.
I’m a Ruby user, although it’s a slightly older version, and I’ve never seen this.
Did you make edits to the theme? It appears that that first post is broken because it is trying to put the full post content (including the CTA) onto the page. (You can see if it you inspect the HTML on the page.)
Alternative guess - something is really wrong with how the custom excerpt is being generated.
I did make some edits as seen in my previous request for help, but nothing that I thought affected the Member-only posts. Hmm. Very confused by this.
Post the loop that creates the cards?
I’m not even sure how to do that. I’m such a noob at this, constantly fumbling about. 
Here’s my loop file:
<style>
.post-feed .featured .post-wrapper {
flex-direction: column;
justify-content: flex-end;
}
.post-feed .featured .post-excerpt {
/* The excerpt is hidden by default on featured posts. We don't want to do that */
display: unset;
}
</style>
<article class="{{post_class}} featured u-shadow"{{#if primary_tag.accent_color}} style="--tag-color: {{primary_tag.accent_color}};"{{/if}}>
<a class="post-link" href="{{url}}">
{{#if feature_image}}
<img
class="post-image u-object-fit"
src="{{img_url feature_image}}"
alt="{{title}}"
loading="lazy"
>
{{/if}}
<div class="post-wrapper">
<header class="post-header">
{{#primary_tag}}
<span class="post-tag">{{name}}</span>
{{/primary_tag}}
<h2 class="post-title">
{{title}}
</h2>
</header>
{{#if excerpt}}
<div class="post-excerpt">
{{content words="20"}}
</div>
{{/if}}
</div>
<footer class="post-footer">
<span class="post-more">
{{#if excerpt}}
{{excerpt words="5"}}
{{/if}}
</span>
</footer>
</a>
</article>
As an FYI, you’re writing that style section out for every card. You might want to relocate it.
This section here is your problem. You’re calling ‘content’,
{{#if excerpt}}
<div class="post-excerpt">
{{content words="20"}}
</div>
{{/if}}
But because the post is restricted access, you get a whole CTA shoved in there, along with everything above the paywall. (It doesn’t appear that ‘words’ is working correctly. That probably needs a bug filed…)
You can replace the {{content words="20"}}
with {{excerpt words="20"}}
, which should fix the behavior.
1 Like
Thanks so much, Cathy! That seems to have worked!
I know this is probably a ridiculously stupid question, but… should I just paste it into an existing css file or… ?
Most themes, including Ruby, need their css compiled. If you just want to make a few tweaks, putting one copy (within style tags of course) into default.hbs or just putting it in site wide code injection is simplest. You don’t really want it in that loop because then ghost writes it out repeatedly. :)
Unfortunately, I had to revisit this issue because I realized this solution:
You can replace the {{content words="20"}}
with {{excerpt words="20"}}
, which should fix the behavior.
which did fix the display issue had the excerpt appearing rather than the first 20 words of the content. I need the content to appear, not the excerpt. In my posts the excerpt is the price (or the word sold). The content is the condition of the item for sale. With Cathy’s fix, the excerpt was appearing twice, though it did fix the display issue.
Is there a way to keep my initial Loop file (posted above) but have the corrected code Cathy_Sarisky posted to sub in for a featured post? Then I will just make all my members-only posts featured posts as I don’t use the featured post function otherwise?
If you have the post set to members only, you cannot get the content. You can get the start of the content plus the paywall text if you’ve added a public preview card. I’m suspicious that words is not working well with the paywall card, but haven’t made time to test.