"Read Next" on Headline Theme question

Hey all,

I reinstalled the Headline Theme on our site and the “Read Next” section on the bottom of posts is pretty stagnant and rarely changes the same posts that appear.

I suspect it’s because we use a lot of similar tags in order to keep subjects linked together but, ideally, I’d like to continue to be able to post multiple posts under multiple topics and have that section grab a greater collection of posts. Or even simply have the most recent posts under a particular tag appear, rather than much older posts with little relevance to today.

Anyone have any good ideas on how to correct this/make the “Read Next” section of the Headline Theme more dynamic at the bottom of posts?

Thank you for your suggestions.

The Read Next section fetches related content using the code in this file: Headline/related-posts.hbs at main · TryGhost/Headline · GitHub

Basically, it fetches the first three posts that match any of the tags on the current post. Your suspicion about your content is likely correct.

Another approach would be to just fetch the latest post in a certain tag. For example, fetch the most recent post in Science, Politics, and Sports. The downside would be that each post would have the same Read Next until new content is published.

Thanks @TheRoyalFig. Do you have an idea of best practice for the code to adjust so the most recent posts in that particular category/tag appears?

I’d do something like this:

{{#is "post"}}
  <div class="gh-read-next gh-canvas">
    <section class="gh-pagehead">
      <h4 class="gh-pagehead-title">Read next</h4>
    </section>

    <div class="gh-topic gh-topic-grid">
      <div class="gh-topic-content">
        {{#get
          "posts"
          include="authors"
          filter="tag:science+id:-{{post.id}}"
          limit="1"
          as |science|
        }}
          {{#if science}}

            {{#foreach science}}
              {{> "loop-grid"}}
            {{/foreach}}

          {{/if}}
        {{/get}}

        {{#get
          "posts"
          include="authors"
          filter="tag:politics+id:-{{post.id}}"
          limit="1"
          as |politics|
        }}
          {{#if politics}}

            {{#foreach politics}}
              {{> "loop-grid"}}
            {{/foreach}}

          {{/if}}
        {{/get}}

        {{#get
          "posts"
          include="authors"
          filter="tag:art+id:-{{post.id}}"
          limit="1"
          as |art|
        }}
          {{#if art}}

            {{#foreach art}}
              {{> "loop-grid"}}
            {{/foreach}}

          {{/if}}
        {{/get}}
      </div>
    </div>
  </div>
{{/is}}

You’ll want to change the tags to match whatever topics you want to target. One downside of going this route is that it doesn’t hide the section if there’s no content as in the original version. That is only a problem if you don’t have content but that doesn’t seem to an issue. Let me know how it goes.

Interesting. I’ll have to do some more looking into how to implement just the most recent from the category/tag that the individual post is already under. Thank you for the replies, I appreciate your time.