[Resolved] How to show only updated date on blog and search engine

Home Forums Support [Resolved] How to show only updated date on blog and search engine

Home Forums Support How to show only updated date on blog and search engine

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1123268
    Mfon

    Hello,

    I have tried without success to show only updated post not published date on posts and search engine. Can you help?

    #1123379
    David
    Staff
    Customer Support

    Hi there,

    add the PHP Snippet provided here to force the Theme to only output the modified date ( if it exists ):

    https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date

    Whether the search engine chooses to display an updated date is down to their algorithms, the theme itself cannot force it to change

    #1125915
    Mfon

    Where do I add this? FUnction.php or hook?

    #1126115
    David
    Staff
    Customer Support

    In your child theme functions.php or use the code snippets plugin.
    more info her:

    https://docs.generatepress.com/article/adding-php/

    #1128008
    Mfon

    Thank you.

    I will like to show it in this format Updated: January 10, 2020

    Can you help on this?

    #1128194
    David
    Staff
    Customer Support

    Look for this line in the code:

    $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">%4$s</time>';

    and change it to:

    $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Updated: %4$s</time>';

    #1128202
    Mfon

    Thank you. My biggest concern is changing the date format to something like this January 10, 2020

    #1128213
    David
    Staff
    Customer Support

    You can change the date format in Dashboard > Settings > General – it should still work with that function enabled.

    #1128214
    Mfon

    Oh my bad! I forgot!

    Thank you

    #1128215
    David
    Staff
    Customer Support

    Happy to be of help πŸ™‚

    #1128335
    Mfon

    Thanks again

    #1128384
    David
    Staff
    Customer Support

    You’re welcome

    #1134900
    Mfon

    Hello,

    The code has stopped working πŸ™

    #1135433
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Can you share the exact code you’re using?

    Also, can you make sure the date is enabled in Customize > Layout > Blog?

    Let me know πŸ™‚

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.