我使用的是214主题,我认为在档案部分显示完整的帖子是愚蠢的。我只想显示标题以便于导航。即使去掉日期也不错。(我已经为个人帖子这么做了,但档案科仍然说是2014年5月。)但这是次要的。我想知道的主要事情是如何只显示标题。
我已经看过档案了。php文件(包含在下面),但不懂php,也不知道该怎么做。我通过google找到的建议已经过时,代码示例与我的不匹配。仁慈的互联网领主们,请告诉我需要做些什么改变,这样我的网站才不会那么糟糕。
get_header(); ?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title">
<?php
if ( is_day() ) :
printf( __( \'Daily Archives: %s\', \'twentyfourteen\' ), get_the_date() );
elseif ( is_month() ) :
printf( __( \'Monthly Archives: %s\', \'twentyfourteen\' ), get_the_date( _x( \'F Y\', \'monthly archives date format\', \'twentyfourteen\' ) ) );
elseif ( is_year() ) :
printf( __( \'Yearly Archives: %s\', \'twentyfourteen\' ), get_the_date( _x( \'Y\', \'yearly archives date format\', \'twentyfourteen\' ) ) );
else :
_e( \'Archives\', \'twentyfourteen\' );
endif;
?>
</h1>
</header><!-- .page-header -->
<?php
// Start the Loop.
while ( have_posts() ) : the_post();
/*
* Include the post format-specific template for the content. If you want to
* use this in a child theme, then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( \'content\', get_post_format() );
endwhile;
// Previous/next page navigation.
twentyfourteen_paging_nav();
else :
// If no content, include the "No posts found" template.
get_template_part( \'content\', \'none\' );
endif;
?>
</div><!-- #content -->
</section><!-- #primary -->
<?php
get_sidebar( \'content\' );
get_sidebar();
get_footer();