Add How Long Ago A Post Was Published To Genesis Post Info

This code creates a custom shortcode which you can use to display how long ago a post was published. For example, this screenshot shows the post was published 2 days ago.

The code displays the amount of seconds, minutes, hours, days, weeks, months or years ago the post was published.

Demo Video

Shows how long ago standard posts and featured posts where published in Genesis child themes.

Tested using the Genesis Sample child theme by StudioPress however will work in any Genesis child theme.

Installation Steps

There’s 2 steps :

  1. # Copy & paste the 2 PHP code snippets ( excluding the opening PHP tag ) from the functions.php file to the end of your child themes functions file.
  2.  

  3. # Optional : Add the shortcode named [post_time_ago] to the Genesis Featured Posts widgets > Show Post Info field if you want to add how long ago a featured post was published.
  4.  

Download Folder

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.