Support » Fixing WordPress » show modified date only when modified

  • Resolved eagerbob

    (@eagerbob)


    Hello all.

    I have a custom post type where I show the last modified date with <?php the_modified_date('d-m-Y'); ?>

    Now I want to change that so that the last modified date shows *only* when the file has been modified after it has been published.

    Could that be done and how?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • show it only if modified is different from publish date;

    example:

    <?php if( get_the_time('d-m-Y') != get_the_modified_time('d-m-Y') ) the_modified_date('d-m-Y'); ?>

    Thread Starter eagerbob

    (@eagerbob)

    Simple as that…

    Thanks alchymyth!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘show modified date only when modified’ is closed to new replies.