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

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems