• Resolved jfkweb

    (@jfkweb)


    Hi, thank you for this life saving plugin!

    I am using the shortcode within a small soliloquy plugin addon which is causing it to output 5 minutes for all posts. Does some variable need to be passed into this plugin to read the rt_reading_time? code below. Many thanks.
    Frank

    <?php
    /**
    * Plugin Name: Soliloquy - Display Post Age & Read Time
    * Plugin URI: https://soliloquywp.com
    * Version: 1.0
    * Author: Soliloquy Team
    * Author URI: https://soliloquywp.com
    * Description: Adds the Published Date, Author and Taxonomy Terms for Featured Content slides
    */
     
    function sol_soliloquy_fc_date_terms( $content, $post, $data ) {
           
        // Start Config
        $sliderSlugs = array(
            'beauty',
            'fashion',
            'interiors',
            'gloss-live',
            'events',
            'mindourselves',
        );
           
        // Check slider ID is the one we want to amend
        if ( ! in_array( $data['config']['slug'], $sliderSlugs ) ) {
            return $content;
        }
           
        // Build date and taxonomy terms content
        $additional_content =       
        '<div class="soliloquy-fc-date">'
            . __( '', 'soliloquy-featured-content-date-terms' ) . get_the_date( 'dS F Y', $post->ID ) . "<span>" . " BY " . "</span>" . "<br>" . "<span class='slide-author'>" . get_the_author() . "</span>" . ' 
        </div>' .  
         '<div class="read-time">' .  do_shortcode('[rt_reading_time label="" postfix="minute read" postfix_singular="minute read"]') . '</div>';
       
        // Return content
        return  $additional_content . $content;
       
    }
    add_filter( 'soliloquy_fc_caption', 'sol_soliloquy_fc_date_terms', 1, 3 );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jason Yingling

    (@yingling017)

    Hi there,

    In Reading Time WP 2.0.5 which was released today a new optional parameter was added to the shortcode for passing a post ID. This may resolve your issue. Make sure you’re updated to Reading Time WP 2.0.5 and try updating your do_shortcode to this:

    do_shortcode('[rt_reading_time label="" postfix="minute read" postfix_singular="minute read" post_id="' . $post->ID . '"]')

    Thread Starter jfkweb

    (@jfkweb)

    Thanks Jason, that’s working! Thanks so much.

    Frank

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reading time outputting % minutes for all posts’ is closed to new replies.