首页 文章

将类别 Headers 添加到WordPress主题文件

提问于
浏览
0

在我的自定义WordPress主题的archives.php文件中,我有以下代码:

<div class="page-title">
<?php
                if ( is_day() ) :
                    printf( __( 'Daily Archives: %s', 'sturd' ),     '<span>' . get_the_date() . '</span>' );
                elseif ( is_month() ) :
                    printf( __( 'Monthly Archives: %s', 'sturd' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'sturd' ) ) . '</span>' );
                elseif ( is_year() ) :
                    printf( __( 'Yearly Archives: %s', 'sturd' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'sturd' ) ) . '</span>' );
                else :
                    _e( 'Archives', 'sturd' );
                endif;
            ?>
</div>

我希望有另一个声明,这样如果这是一个类别页面,它只显示页面 Headers div中的类别 Headers ,而不仅仅是单词Archives(就像它当前那样) .

我希望这张贴在正确的部分 .

提前致谢 .

山姆

1 回答

相关问题