Last Modified Date Shortcode For Genesis Post Info

Update: Genesis now includes 2 short codes for post modified date and post modified time:

[post_modified_date]
[post_modified_time]

You can use one or both in the Genesis Simple Edits plugin or code like this in your functions file:

This code creates a new shortcode which you can add to your post info or post meta field in Genesis.

Please copy ALL the PHP code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++

You can now add the shortcode named modified_date using this custom function.

updated date

Video Demo

Related Tutorials


Comments

15 responses to “Last Modified Date Shortcode For Genesis Post Info”

  1. Canberk Avatar
    Canberk

    I use eleven40 pro theme and this worked. Thank you.

    While using Yoast SEO plugin to determine the search engine appearance, I use basic variables here:
    https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/

    Is it possible to add a variable that calls the modified date? Something like %%modified_date%% since we created one now?

    1. I’m sure it is however the code for that would need to be written and tested which is only provided for registered users

  2. […] on Genesis themes it is a little more difficult to find a good guide. Luckily Brad Dalton from wpsites.net  have published a code snippet that works very […]

  3. I also use genesis (their latest update and lifestyle theme version 1.0 )
    Mine is a static site no blogs as yet but planning to, however I am confused since mine are all pages not actual blog pages yet even for page even all have same errors in webmaster tools and Structured Data says:

    Missing required field “entry-title”.
    Missing required field “updated”.
    Missing required hCard “author”.

    and why do I need to authorship for pages as static site since it is not a blog yet?

    Would these above errors stop my pages from actually being seen by google ?
    Doing the site:wwwMyDomainName.com in google search box finds and see all my pages -Plus webmaster tools ‘Fetch as google’ finds these pages and complete them ok by the way and no crawl errors in 90 days also!

    your thoughts on what I have said would be helpful many thanks

    1. Brad Dalton Avatar
      Brad Dalton

      Those errors relate to the Google Rich Snippets.

      The latest version of Genesis includes code which outputs the updated data so that error should disappear.

      The entry title error shouldn’t occur if the page includes a title.

      Seems you haven’t included Google authorship which you can do following this tutorial

      I wouldn’t worry to much about these errors as i don’t think they have any impact on rankings.

      You may want to get a second opinion by posting this question on the Google Webmaster forums or Stackexchange Webmaster forums.

      1. Thanks Brad for replying yes all pages have titles so no ideas why its says Missing required field “entry-title”

        any ideas?
        using google search box
        add in:
        site:www.TheDomainName.com
        one can see all my pages names how weird

        you said Those errors relate to the Google Rich Snippets.

        The latest version of Genesis includes code which outputs the updated data so that error should disappear.

        Well Have the latest version indeed always keep this updated yet the errros are there still?

        1. Brad Dalton Avatar
          Brad Dalton

          Not sure how fresh the error reports are as Google’s data can be months old.

          1. The errors are as of now latest, so again no idea why for static pages they come up as errors as mentioned and you say genesis latest version should cure it well we as mentioned have genesis later version!

            You mentioned The entry title error shouldn’t occur if the page includes a title.

            I use a plug sometimes for certain page titles

            So one can use a page title in the content area Instead of usual page title field area) and apply H1 to it not every page but do use it quite a bit for some and hence the so called errors But google is smart enough to know it is a H1 so must be title. Why at times do I use this plugin?

            It allows to have long sentences as your page title nicely laid out on two lines plus one can have one sentence a certain text color and the line under it another color and stand out rather well plus layout of title spacing is so much better.

            Please let me know your thoughts

          2. Brad Dalton Avatar
            Brad Dalton

            Rather than use a plugin, you can re-position the entry title using PHP code which is only 2 lines. I would also suggest looking at re-positioning the markup as well which includes the entry header.

          3. Brad you said in reply:
            Rather than use a plugin, you can re-position the entry title using PHP code which is only 2 lines.
            No idea what you specifically mean by re position or what and where such code would go did say I am total non techie never done a code in my life

            you also said
            I would also suggest looking at re-positioning the markup as well which includes the entry header

            again no idea what you specifically mean by the wording phase:
            re-positioning the markup ?
            ( or how to do it!)

          4. Brad Dalton Avatar
            Brad Dalton

            Firstly Tanya

            Please use your real email address attached to a real Gravatar image.

  4. Satyajeet Mishra Avatar
    Satyajeet Mishra

    Hi! Brad,

    Came to your site after going through so many other sites on how to use the modified/updated date. By far the most elegant and versatile solution is Your Shortcode on Modified Date + Simple Edits + Simple Hooks. Especially for beginners.

    Thanks a ton for this Shortcode.

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks for the positive feedback Satyajeet

  5. Fuvestibular Avatar
    Fuvestibular

    Great tutorial, Brad!

    But should not the itemprop of the last modified date be “dateModified” instead of “datePublished”?

    I think it might cause some minor issues with the search engines if the published time keeps going towards the future every post update.

    By the way: Great content you have available here, specially for genesis users! Bookmarked already!

    1. Brad Dalton Avatar
      Brad Dalton

      Good point. Updated the code with your suggestion.

      Thanks for the feedback, always welcome.

Leave a Reply

Join 5000+ Followers

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