コード例 #1
0
ファイル: meta-box.php プロジェクト: JeppeSigaard/bornegarden
function the_post_subtitle($post = false)
{
    if (!$post) {
        $post = get_the_ID();
    }
    if (has_post_subtitle($post)) {
        echo get_post_subtitle($post);
    }
}
コード例 #2
0
ファイル: content.php プロジェクト: JeppeSigaard/bornegarden
if ('kalender' === get_post_type(get_the_ID())) {
    ?>
        <h2 class="page-subtitle">
            <?php 
    echo strftime('%d. %B', strtotime(get_post_meta(get_the_ID(), 'start_date', true)));
    ?>
            <?php 
    echo date('H.i', strtotime(get_post_meta(get_the_ID(), 'start_date', true)));
    ?>
 -
            <?php 
    echo date('H.i', strtotime(get_post_meta(get_the_ID(), 'end_date', true)));
    ?>
        </h2>
        <?php 
} elseif (has_post_subtitle()) {
    ?>
        <h2 class="page-subtitle"><?php 
    the_post_subtitle();
    ?>
</h2>
        
        <?php 
}
?>
    </header>
    <?php 
the_content();
?>
</article>
</section>