[Resolved] Show Reading time on WP Show Posts (home page)

Home Forums Support [Resolved] Show Reading time on WP Show Posts (home page)

Home Forums Support Show Reading time on WP Show Posts (home page)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1987104
    Charbel

    Hello @David and @Leo,

    I am using an Element to display the estimate reading time on every article (post).

    Here is PHP code from the Element (generate_after_entry_title):

    <?php
    function custom_estimated_reading_time() {
        global $post;
        $content = $post->post_content;
        $wpm = 300; // How many words per minute.
        $clean_content = strip_shortcodes( $content );
        $clean_content = strip_tags( $clean_content );
        $word_count = str_word_count( $clean_content );
        $time = ceil( $word_count / $wpm );
        return $time . ' Min. ';
    }
    ?>
    <div class="read-time"><?php echo custom_estimated_reading_time() ; ?>Read</div>

    How can I use the same Element to display it on WP Show Posts next to the Author name (right side)?
    The author name is on the left, I need to add the estimate reading time on the right-hand side.

    Your help is highly appreciated.

    Article: https://charbelnemnom.com/passing-the-azure-security-center-ninja-training/

    Many Thanks!
    -Charbel

    #1987110
    Leo
    Staff
    Customer Support

    Hi Charbel,

    Please open a support topic in WPSP’s support forum here as the question is a WPSP specific question:
    https://wordpress.org/support/plugin/wp-show-posts/

    Thank you!

    #1987127
    Charbel

    Thank you @Leo, I will do.

    I have opened here under the Pro version:

    https://wpshowposts.com/support/topic/show-reading-time-on-wp-show-posts-home-page/#post-35157

    #1987139
    Leo
    Staff
    Customer Support

    Even better.

    Elvin will get to it later.

    Thanks!

    #1987150
    Charbel

    Super, many thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.