Nesting/linking blog posts?

Hello,
I’m curious if there’s a way to nest and connect blog posts? I have a client who needs to have sub articles within each main article. They have this already set up within Wordpress, with the ability to define the sub articles while creating the main article.

While testing migration of their blog posts (using WP All Export + Matrixify) the sub articles do have a metafield titled “issue_attached_to” which gives the title of the parent blog post. I’m hoping I can utilize that to connect them somehow?

Is this possible in Shopify? I’m guessing some type of app might be required?

Any advice is appreciated!

Do you mean there is a link in the blog content that can access the parent blog?

Hi Jason, if you have a metafield attached, then you can use the custom code to display sub articles under that articles by using Graph API.

@kyle_liu, yes but the other direction… the parent blog post shows the child blog post with its featured image in the content. Within the Wordpress interface, the user has the ability to select which blog posts should be children, which populates that automatically somehow.

@Arslan_Saleem, ok that sounds promising. I haven’t used the Graph API… do you know any good resources for that?

You’t have to use GraphQL for this. You can just use Liquid.

Yes correct, we can achieve it with Liquid as well.
I mixed 2 answers in same the question here.

@Luke, ok that’s good to know! I’m not fully sure how to go about implementing something that would solve the client requirements.

I’m guessing I’d need to add a custom metafield for the sub posts to pull in the “issue_attached_to” data, then use a liquid snippet to loop through to find the matching data to render?

Follow the steps below

  1. Create metafield (If already created, ignore this step)



  1. Edit theme code:

In main-article.liquid file (Dawn theme)


{% if article.metafields.custom.issue_attached_to != blank %}
        <span class="caption-with-letter-spacing">
              <span>
        issue_attached_to: {{ article.metafields.custom.issue_attached_to }}
              </span></span>
      {% endif %}

@kyle_liu yes, that’s essentially what I had started to tinker on, thanks! I’ll mark this as the solution.