Relative Date Lengths in Genesis

Genesis has always allowed you to display the relative post date like “6 weeks and 1 day ago” using [[post_date format="relative"]]. It displays two date segments – days and hours, or weeks and days, or months and weeks, or years and months…

In some layouts, especially if you’re using a Grid Loop, a shorter date with a single date segment would work better.

And now you can with Genesis 2.3, using the relative_depth parameter. This applies to the [[post_date]] and [[post_modified_date]] shortcodes.

Examples:

[[post_date format="relative" relative_depth="1"]] = 8 months ago

[[post_date format="relative" relative_depth="2"]] = 8 months and 4 days

[[post_date format="relative" relative_depth="3"]] = 8 months, 4 days and 4 hours ago

genesis

Receive New Posts by Email

Comments

  1. Hi,
    i am freelance web designer n developer 🙂
    i read lots of internet stuff, and this is first time i have ever stopped on a blog to leave comment.
    i have read few of your whole posts, so i want to say: you sir, are really veteran developer. i am almost seeing u as icon now. Please keep up the good work. i ll be visiting regularly.
    Thank you.

Leave a comment