Excerpt in homepage, category, tag and author pages for WordPress theme Twenty Thriteen

Excerpt in homepage, category, tag and author pages for WordPress theme Twenty Thriteen. Also add the “read more” link after the excerpt.

The patch:

diff --git a/wp-content/themes/twentythirteen/content.php b/wp-content/themes/twentythirteen/content.php
index 4f61b22..53b4686 100644
--- a/wp-content/themes/twentythirteen/content.php
+++ b/wp-content/themes/twentythirteen/content.php
@@ -30,7 +30,7 @@
 		</div><!-- .entry-meta -->
 	</header><!-- .entry-header -->
 
-	<?php if ( is_search() ) : // Only display Excerpts for Search ?>
+	<?php if ( is_search() || is_home() || is_category() || is_tag() || is_author() ) : // Only display Excerpts for Search ?>
 	<div class="entry-summary">
 		<?php the_excerpt(); ?>
 	</div><!-- .entry-summary -->
diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php
index b4234bf..26d41f0 100644
--- a/wp-content/themes/twentythirteen/functions.php
+++ b/wp-content/themes/twentythirteen/functions.php
@@ -524,3 +524,14 @@ function twentythirteen_customize_preview_js() {
 	wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
 }
 add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
+
+
+/**
+ * Add read more to excerpts
+ */
+function new_excerpt_more( $more ) {
+    return '... <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">read more</a>';
+}
+add_filter( 'excerpt_more', 'new_excerpt_more' );
+
+
diff --git a/wp-content/themes/twentythirteen/style.css b/wp-content/themes/twentythirteen/style.css
index 60d0416..2917647 100644
--- a/wp-content/themes/twentythirteen/style.css
+++ b/wp-content/themes/twentythirteen/style.css
@@ -1,5 +1,5 @@
 /*
-Theme Name: Twenty Thirteen
+Theme Name: Twenty Thirteen - fclose
 Theme URI: http://wordpress.org/themes/twentythirteen
 Author: the WordPress team
 Author URI: http://wordpress.org/
@@ -3118,4 +3118,4 @@ footer.entry-meta {
 	.comment-reply-login {
 		color: #333;
 	}
-}
 No newline at end of file
+}

Similar Posts

  • MFC程序使用系统风格界面

    VC6默认编译出来的程序在XP下Luma风格下运行也是Windows的经典界面, 有损界面的美观与统一. VC2008默认设置下如果不是使用的unicode也是如此. 本文给出使VC6和VC2008可以编译出使用系统界面风格的解决方案. 1. 使VC6编译出使用系统风格的程序 步骤如下: 1) 创建一个.manifest文件的资源. 在res/文件夹下创建一个跟以程序名加.manifest的文件, 如果程序为test.exe, 则创建test.exe.manifest 文件可由此下载: https://www.systutorials.com/t/g/programming/resultcollector.manifest/ 注意要使用utf-8编码保存。 2) 将新定义的资源加入到.rc2文件中, 类型设为24. 打开res/文件夹下的.rc2文件, 在其中加入如下定义: 1 24 MOVEABLE PURE “res/test.exe.manifest” 其中的文件地址按1)步中修改的设置即可. 之后编译即可, 为了使程序界面可能充分利用系统的界面特性, 可以将界面字体设置为TrueType类型的, 利用Windows XP等系统的屏幕字体平滑特性. 2. 使VC2008编译出使用系统风格的程序 在VC2008下就比较简单了, 如果程序字符集使用unicode则默认就是使用系统界面风格的, 如果选择其它的类型, 则编辑下stdafx.h即可. 最后面部分找到这么一段: #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,”/manifestdependency:”type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’x86′ publicKeyToken=’6595b64144ccf1df’ language=’*'””) #elif defined _M_IA64 #pragma comment(linker,”/manifestdependency:”type=’win32’…

  • How to un-trust a computer that I have trusted with iOS 7 device?

    How to un-trust a computer that I have trusted with iOS 7 device, such as iPhone? You can delete the Lockdown folder to reset the trust/un-trust status of iPhones. Apple provides tutorials for Max OS X and Windows at: http://support.apple.com/kb/TS5335 (archived) . If you are using Linux, the Lockdown folder is: /var/lib/lockdown Answered by Lucy….

Leave a Reply

Your email address will not be published. Required fields are marked *