Support » Plugin: Custom Content Shortcode » Reading time?

  • Resolved misterbates

    (@misterbates)


    Has anyone worked out a way to show the estimated reading time for each post? I don’t think it’s available as a field, but it could be calculated by dividing the word count of a post (less formatting) by 200 …

Viewing 5 replies - 1 through 5 (of 5 total)
  • Try ACF calculated fields – or use the calc shortcode.

    Thread Starter misterbates

    (@misterbates)

    Great suggestions – thanks!

    Maybe I’m missing something, but:
    * I’m wanting to display something based on post size/word count
    * ACF looks like it returns the content of custom fields, not post size/word count
    * [calc] might work, but it needs the post size/word count as a variable
    * [wp-word-count] looks like it operates within the context of a post – would that work inside a [loop]?

    … still looking

    Write your own shortcode where you pass an post_id and get back the word count for the relevant post. Then you can call this shortcode within a loop.

    If you would like to build the loop with the word-count you need to write that value somewhere or to pass a list with matching ids to the loop.

    For that I use own shortcodes. I give the shortcode the id of one location and a distance to search in and it delivers back a list of ids for a loop.

    Or for translations with polylang – I pass the id of one language and the desired language and get back the id of the translated post to use in loops.

    Thread Starter misterbates

    (@misterbates)

    A great bit of advice. I could write my own , but it would be my first attempt using PHP and I’m a little time-pressed right now. So a bit of googling, and I found
    https://wordpress.org/plugins/reading-time-wp/.

    The plug-in provides a shortcode to control the positioning of the reading time, has settings to adjust reading speed and the shortcode works “out of the box” inside a [loop] – perfect!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Reading time?’ is closed to new replies.