Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter philip2041

    (@philip2041)

    I think maybe this will work, but I’m not sure:

    Replace

    <div class="entry-meta">
    	<?php puresimple_posted_on(); ?>
    </div><!-- .entry-meta -->

    with

    <div class="entry-meta">
           echo 'Updated on:' . the_modified_date() ;
     </div><!-- .entry-meta -->
    Theme Author Styled Themes

    (@gejay)

    Hello @philip2041,

    Just replace as you stated above with;

    <div class="entry-meta">
         <?php _e( 'Updated On ', 'pure-simple' );  the_modified_date() ; ?>
    </div>

    Thanks!

    Thread Starter philip2041

    (@philip2041)

    Hello @gejay,

    Thank you so much for the reply! I will try the code you gave me.

    Thread Starter philip2041

    (@philip2041)

    Hi @gejay ,

    The code you gave me does can make the post show “Updated On mm/dd/yyyy” under the title.

    However, as I checked with browser’s inspect element tool, the original “Published on mm/dd/yyyy” has <time> tag wrapped on the date, but now the “Updated On mm/dd/yyyy” is just plain text.

    So will the date still be shown on search engine result page? My main purpose is to make the updated date to show on the search engine result page, but I don’t know how search engines determine and display the date of a post, is that <time> tag important?

    Thanks!

    Theme Author Styled Themes

    (@gejay)

    Hello @philip2041,

    Here’s a tweak you can make;
    1. Undo the changes inside content-single.php
    1. Add the following CSS inside Customize>>Additional CSS;

    .single-post time.entry-date.published {
        display: none;
    }
    .single-post time.updated {
        display: inline;
    }

    2. Go to pure-simple/inc/template-tags.php and modify Published On to Updated On as follows;
    Inside function puresimple_posted_on() {....}

    $posted_on = sprintf(
    		__( 'Updated on %s', 'pure-simple' ),
    		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
    	);

    Note: You can build the template tag of your own. We don’t recommend you to make changes in the parent theme unless you’re updating the theme or applying hooks in child theme. It’s because the changes lost upon further theme updates.

    Thanks!

    Thread Starter philip2041

    (@philip2041)

    Hi @gejay ,

    The above measure perfectly works! Now my posts can show Updated Date with the same format and html tags as that of Published Date.

    Thank you so much!

    There’s still one more thing I want to ask, I found that the Published Date is not removed but is just ‘hided’ with CSS, will Google still using Published Date as the date of my posts shown on their search result pages?

    Thanks!

    • This reply was modified 5 years, 2 months ago by philip2041.
    Thread Starter philip2041

    (@philip2041)

    Hi @gejay ,

    I found something useful about how search engine determines date of post:
    https://webmasters.stackexchange.com/questions/18395/how-does-google-recognize-publish-date-of-a-post
    https://webmasters.googleblog.com/2019/03/help-google-search-know-best-date-for.html

    According to Google webmaster blog, Google determines the date of a post using a variety of factors.

    It seems that the html tags is not a important sign it will use to determine a post’s date, because I found that the updated date of posts on Lifewire.com is just written in regular <div> tag, the updated date can still be shown on Google search result pages.

    In my opinion, Google may looks for the text of date that is shown next to the post title and uses it as the date shown on search result page.

    I don’t know whether your CSS method will work to make the updated date show on search result page, I will try it first and wait to see the result.

    If it doesn’t work, I think the published date should be removed in the code, or place it behind the updated date.

    Thanks!

    Theme Author Styled Themes

    (@gejay)

    Hello @philip2041,

    All hidden text is not considered misleading.
    For instance; Reference for hidden texts and links

    Please see the result and let us know.

    Note: We don’t recommend you to modify the parent theme unless you’re performing any updates.

    Thanks!

    Thread Starter philip2041

    (@philip2041)

    Hi @gejay ,

    I didn’t mean misleading.

    As mentioned in the content in the link you posted above, search engine can see the hidden text, so the published date that is hidden with CSS still can be seen by Google, hence its search result page may still display the initial published date for my posts.

    However, I will wait a few days and see the result and let you know if it works.

    Thanks!

    Thread Starter philip2041

    (@philip2041)

    Hi @gejay,

    After I used your method, I waited for about two weeks, only found Google still displays publish date, not update date.

    Then I edited template-tags.php to put the code of Update Date in front of Publish Date, as in that way the Update Date will be the first date seen by search engines, so I thought that will work, but the date shown on Google was still publish date after I waited for another week.

    Then I checked the source code of my web page, and found that a plugin called Yoast SEO adds publish date to the head section in a meta tag, I think it might be that plugin affecting the decision of search engine about the date of post, so I disabled the plugin, and waited for another few days. But still nothing changes on the date shown on search engine.

    At last, I removed the code of publish date in template tags.php, and this time, search engine stopped showing Publish Date of my post, and after a few days it started showing Update Date for my posts.

    So my problem is solved, thanks for all your helps!

    Jen H.

    (@baseballjen)

    Hi @philip2041 & @gejay

    I need help. I know very, very little about coding and I’m afraid to even try as it might make my site even more messed up! I use a different theme ( which I hope is ok to ask about) anyway, it’s Customizr Theme or whatever … but I want any date to show up on my post on my site. They all just disappeared when I gave my site a makeover this summer – I’d like to have the reader know at least when it was published if not also if and when it has been updated! But my actual site shows nothing!

    And everything gets stranger from there – the thumbnails of the featured pics for my posts on the the home page are all truncated! Ive tried regenerating the thumbnails and nothing changes!!

    And back to the dates = at the bottom of the page the blog shows “Related Posts” to the one that has just been read – and all of those shoe dates!! So why are the dates suddenly gone from the post itself!

    I’m sorry to ask another question but you guys seem knowledgeable so you can at least point me in the right direction – my moblie site is all wrong and very different that it should look!

    It’s like I’m in a nightmare and I can’t fix anything or navigate this site even enough to be able to get anyone to help me! Please if you can’t help can you direct me where to go to find help! I so wanna just scream right now! LOL!

    Thank you for your time!!
    Jen

    Theme Author Styled Themes

    (@gejay)

    hello Jen, if you used a different theme (Customizr) please contact the author of that theme so they can provide you with support https://wordpress.org/support/theme/customizr/

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘How to show ‘Last Update’ date for posts instead of ‘Published’ date?’ is closed to new replies.