Estimated Read Time
The Estimated Read Time plugin for ClassicPress allows you to display expected reading times on your articles and summaries. The average person reads at 200 words per minute, so, that's the default setting. You can change it with a simple filter to suit your own audience and content.
- Download the package to your local computer.
- Navigate to
Dashboard > Plugins > Add New > Upload Pluginand upload the package to your site.
- Click to install, then activate the plugin.
There is only a single setting: the reading speed. To change the reading speed, you can use this filter.
To provide the most versatile placement options, the estimated read time display is implemented with a shortcode that is designed to be placed in your theme template files. It may require some experimenting to find just the right templates for your particular theme, but you can try the
page.php templates as a starting point.
Note that the shortcode is designed to work in templates that are in the loop, so you won't be able to place the shortcode in, say, your
footer.php files. See the examples below and place one or the other into your theme's template file(s) where you would like the estimated read time to be displayed.
Example 1: Minimal template shortcode
<?php echo do_shortcode('[estimated-read-time words="'.str_word_count(strip_tags($post->post_content)).'"]'); ?>
Example 2: Template shortcode with dashicon
<span class="dashicons dashicons-clock"></span> <?php echo do_shortcode('[estimated-read-time words="'.str_word_count(strip_tags($post->post_content)).'"]'); ?>
Important Note on Updating your Theme
If you are using a theme that is a parent theme (as opposed to a child theme) you will need to be cautious about updating your theme because the update will overwrite all the theme files. To avoid this, you have several options, as follows. Options are listed in the order of preference.
- use a child theme and add your shortcodes to your child theme's templates, or
- use a theme that you built yourself to avoid surprise updates, or
- carefully copy your shortcodes out of your theme files before updating, then replacing them afterward, or
- continue using the parent theme, but don't update it.