Is it possible to add estimated read time for blog post in dawn theme? Would like to display estimated read time for in the blog lost, in the blog page, and the blog post section at main page.
If possible, it will be nice if the font is the same as author name and published date. Thank you.
Yes, it is possible to add an estimated read time for blog posts in the Dawn theme on Shopify. Here’s how you can achieve this:
Access your Shopify admin dashboard and go to “Online Store” > “Themes.”
Locate the Dawn theme and click on “Actions” > “Edit code” to open the code editor.
In the code editor, navigate to the “Sections” folder and find the “article-template.liquid” file. This file controls the layout of individual blog posts.
Open the “article-template.liquid” file and find the section where the author name and published date are displayed. This is typically within a
or element with a class or ID assigned to it.
Add the following code snippet after the author name and published date section to display the estimated read time:
This code calculates the number of words in the blog post’s content, divides it by 200 (an average reading speed of 200 words per minute), and adds 1 for an estimated read time in minutes.
Save the changes to the “article-template.liquid” file.
Now, the estimated read time will be displayed in the blog post view. To display it on the blog page and the blog post section on the main page, you’ll need to make similar modifications to the corresponding template files. Locate the relevant files (usually named “blog-template.liquid” for the blog page and “index.liquid” for the main page) and add the same code snippet to the appropriate sections.
You can style the estimated read time by targeting the .estimated-read-time class in your theme’s CSS file. You can adjust the font, size, color, and other styling properties to match the author name and published date.
Remember to save your changes and test the website to ensure that the estimated read time is displaying correctly in the desired locations.
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
In the Dawn theme, adding an estimated read time for blog posts is not a built-in feature. However, you can achieve this functionality by making some customizations to your theme’s code. Here’s a general approach to add the estimated read time:
Open your Shopify admin and go to “Online Store” → “Themes”.
Find your Dawn theme and click on the “Actions” dropdown, then select “Edit code”.
In the theme editor, navigate to the “Sections” folder and locate the file named “article-template.liquid” or a similar file related to blog posts.
Open the file and find the code that displays the blog post content.
Below that section, add code to calculate and display the estimated read time. Here’s an example:
Customize the estimated-read-time class to match the styling you want, such as using the same font as the author name and published date. You can do this by modifying the CSS in your theme’s stylesheet or using inline styles.
Save the changes to the file.
Once you’ve added the code, the estimated read time should be displayed in the blog post sections as specified. Make sure to test it thoroughly to ensure it appears correctly.
Note: The above code assumes an average reading speed of 200 words per minute. You can adjust this value based on your preferences or update the code to use a different approach for calculating the estimated read time.
Remember to backup your theme or use a development theme before making any changes to the code. If you encounter any issues or have further questions, consider reaching out to a Shopify Expert or the Shopify support team for assistance.
Afternoon. I am having the same issue but on the ride theme. It either shows 0 min or 1 min read (definitely longer), how do I fix this on the ride theme please?
we have created an app for this, which helps you add the estimated read time for any Shopify OS2 theme without any coding. At the same time, it allows you to add a reading progress bar to your blog posts as well. It comes with a 7-day trial, if you want to try it out: Estimated Read Time app
I think this code would work the best for you (assuming you are using a language that splits words with spaces). You can change 200 to a different value if you want to adjust the calculation.