Skip to content

Instantly share code, notes, and snippets.

@diije
Created July 2, 2013 15:32
Show Gist options
  • Save diije/5910310 to your computer and use it in GitHub Desktop.
Save diije/5910310 to your computer and use it in GitHub Desktop.
WordPress : afficher la date de dernière modification d'un article, seulement si celle-ci est antérieure à la publication.
<span>
Publié le <?php the_date(); //date de publication ?>
<?php if(get_the_modified_time('Gi') - get_the_time('Gi') > 0)
// si la date de modification est supérieure à la date de publication (ou la soustraction supérieure à 0)
// alors on affiche la date de modification
{ ?>
et modifié le <?php the_modified_date();
} ?>
</span>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment