其中一个例子是在内容中使用模板标记的215。php文件如下:
twentyfifteen_post_thumbnail();
然后是inc/template tags中的template tag函数。php:
if ( ! function_exists( \'twentyfifteen_post_thumbnail\' ) ) :
/**
* Display an optional post thumbnail.
*
* Wraps the post thumbnail in an anchor element on index views, or a div
* element when on single views.
*
* @since Twenty Fifteen 1.0
*/
function twentyfifteen_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>
<div class="post-thumbnail">
<?php the_post_thumbnail(); ?>
</div><!-- .post-thumbnail -->
<?php else : ?>
<a class="post-thumbnail" href="<?php the_permalink(); ?>" aria-hidden="true">
<?php
the_post_thumbnail( \'post-thumbnail\', array( \'alt\' => get_the_title() ) );
?>
</a>
<?php endif; // End is_singular()
}
endif;
我不确定我是否理解你的标题问题,但是你可以查看一下档案。php文件,您将看到以下代码以显示归档页面标题:
<header class="page-header">
<?php
the_archive_title( \'<h1 class="page-title">\', \'</h1>\' );
the_archive_description( \'<div class="taxonomy-description">\', \'</div>\' );
?>
</header><!-- .page-header -->