Custom Enterend Dates Of Creation For Blog Posts Through Liquid

Hi, shopifiers,

We are looking for a way to add 2 boxes to set the time and date in admin, for all blog posts.

This is to counter the wrong timing or publicly state the exact date of the first edit/production, or even a late one, through liquid.

Any help will be huge!

Jacques Hermes Team

The theme used: Supply.

You are to answer us here, not on any of our contact details, these are for clients. Thanks!

Hi there!

This is best accomplished by adding a custom Blog Post metafield definition. You can add this in the Settings area of your shop admin under “Metafields.” Set the field up as follows:

This will unlock the Metafields area on the blog post (might need to hard-refresh to see it):

When you click “Show all” it will take you here:

From there, you will just need to add the liquid code to your template. How you choose to do this is up to you, but this code should be what you need to process and format the entered date/time. Just make sure it is used in a place where the “article” object is accessible :slightly_smiling_face:

{{ article.metafields.custom.custom_post_date.value | date: "%a, %b %d, %Y" }}
1 Like

Hi there!
Thanks for your answer!

We did all the steps but the latter, and it seems it works, are there any backfires from not adding it in the liquid?

Μια ενημέρωση για τον COVID-19 – JACQUES HERMES

the article

Glad I could help!

Storing the metadata with the post will only just store data with it, it won’t re-arrange the posts in the blog feed or render the custom date unless you modify the theme’s liquid code.

1 Like