• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

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

Entry Meta

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.