WordPress 2012主题首页如何只显示标题(不显示全文)

用回经典的2012主题,但首页所有文章都全文展示,显得十分混乱。

可通过修改主题文件方式修改为只显示标题,

1. 打开文件 https://eatash.com/wp-admin/theme-editor.php?file=content.php&theme=twentytwelve

2. 将文件中 entry-content 相关代码改为

<div class="entry-content">
	<!-- show all content by defautl. let us comment it -->
	<!-- <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?> -->
	<!-- show all content by defautl. let us comment it -->

	<!-- added: show all content ONLY for single page -->
	<?php if ( is_single() ) {
	the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) );
	 } 
	?>
	<!-- added: show all content ONLY for single page -->
	
	<?php
	wp_link_pages(
		array(
			'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ),
			'after'  => '</div>',
		)
	);
	?>
</div><!-- .entry-content -->

发表回复