Need a WordPress website this weekend? Start here...

How To Customize Estimated Reading Time Plugin for WordPress

(Reading time: 1 – 2 minutes)

Ben grabbed a coupon to force me to expose my secrets for the “estimated reading time” that leads off each post. I wasn’t going to tell anyone how I did this because it’s so easy, really, it’s a snap. I’m going to show you how to do this in 3 easy steps.

  1. Install Estimated Reading Time plugin. Use “Plugins >> Add New” from the administrative panel.
  2. Modify plugin. Go to the plugin editor and open up estreadtime.php. It looks like this:
    36
    37
    38
    39
    40
    41
    42
    43
    
    else
        $output = sprintf(__("Reading time: %s - %s minutes"), $minutes_fast, $minutes_slow);
     
        if ($return)
           return $output;
        else
           echo $output;
    }

    You want to change lines 40 and 42 so that they look like this:

    39
    40
    41
    42
    43
    
    if ($return)
       return '<p class="estread">' . $output . '</p>';
    else
       echo '<p class="estread">' . $output . '</p>';
    }
  3. Modify CSS. Here’s how mine looks:
    p.estread {
       padding-bottom: 1em;
       font-size: 65%;
       font-weight: bold;
    }

That’s all there is too it!

Or is it…

I’ve done something else pretty sneaky to get exactly the layout I want. Can you guess what it is?

Comments

  1. Dave Doolin says:

    Claudia, this is pretty close to a perfect first php/css project for an aspiring do-it-yourselfer.

    Let me know how it turns out.
    .-= Dave´s last blog ..How Moderating Comments On Your Blog Destroys Conversation =-.

  2. Claudia says:

    Thank you so much for sharing this! Being a PHP novice, I found myself at a complete loss on how to integrate CSS styling with the output. Now I’ve learned something new…many thanks again!

  3. Simon says:

    Thanks for this trick! I wanted to make the text smaller than the default and this worked absolutely perfect!

Trackbacks

  1. [...] Claudia, though, got right to work, implemented the CSS, and left a nice comment in sincere appreciation! [...]

  2. [...] try modifying a useful little plugin as explained in “How To Customize Estimated Reading Time Plugin for WordPress.” You can make these modifications directly in the WordPress plugin editor. If you mess it up, [...]