投稿の場合は記事タイトルの上に日付が出るのに固定ページの場合は出ないので、投稿と同じ位置に固定ページの投稿日を出すようにしたい。
本当は themify_before_page_title みたいなフィルターフックがあればいいんだけど残念ながら無いので(themify_before_post_title はあるのに!) DOM ツリー的に全く同じ位置に出すことはできない。ただ、見た目上で同じような部分に表示させることはできる。
| 1 2 3 4 5 6 7 8 | add_filter('themify_content_start', 'custom_themify_content_start'); function custom_themify_content_start() {     global $themify;     $created_date = get_the_time(get_option('date_format'));     if (is_page() && $themify->page_title != "yes") {         echo '<time datetime="' . get_the_time('o-m-d') . '" pubdate>' . $created_date . '</time>';     } } | 
このように themify_content_start フィルタを使用することで記事タイトルの上あたりに日付を表示させられる。is_page() を忘れないように。$themify->page_title != "yes" の部分はタイトル表示/非表示設定と連動させるために加えたもので、不要なら削除してもOK。
以下のように page.php にコードを挿入することで投稿記事と全く同じ位置(記事タイトルの直前)に日付を出せる。この場合はテーマをアップデートすると上書きされてしまうため修正し直す必要があるので注意。
| 35 | <h1 class="page-title" itemprop="name"><?php the_title(); ?></h1> | 
↓
| 35 36 | <time datetime="<?php the_time('o-m-d') ?>" class="post-date" pubdate><?php the_time(get_option('date_format')); ?></time> <h1 class="page-title" itemprop="name"><?php the_title(); ?></h1> | 
