functions.php
/**
* 最終更新日を取得
*
* @param string $format 日付フォーマット
* @return string 最終更新日 - 投稿日より新しい場合に最終更新日を返す
*/
function get_last_modified($format)
{
$posted_time = get_the_time('Ymd');
$modified_time = get_the_modified_time('Ymd');
if ($posted_time > $modified_time)
{
return get_the_time($format);
}
elseif ($posted_time === $modified_time)
{
return null;
}
else
{
return get_the_modified_time($format);
}
}