# [WordPress]把繼續閱讀的"Read more..."改成文章名稱

- URL: https://justfly.idv.tw/wordpress%e6%8a%8a%e7%b9%bc%e7%ba%8c%e9%96%b1%e8%ae%80%e7%9a%84read-more-%e6%94%b9%e6%88%90%e6%96%87%e7%ab%a0%e5%90%8d%e7%a8%b1/
- 日期: 2009-07-10
- 分類: WEB&amp;RIA
- 標籤: php, seo, theme, WordPress

之前有一位網友阿猴很熱心的說要教我

不過在公司都沒有啥時間把我的THEME傳給他改

利用一點時間研究一下自己解決了

http://farm3.static.flickr.com/2507/3704801984_dc5395a65e.jpg http://farm4.static.flickr.com/3437/3704849884_82921d917e.jpg

有興趣的人可以參考看看…

wp-includes/post-template.php更改

```
if ( count($content) > 1 ) {
		if ( $more ) {
			$output .= ''.$content[1];
		} else {
			$output = balanceTags($output);
			if ( ! empty($more_link_text) )
				$output .= apply_filters( 'the_content_more_link', '
```

wp-content/themes/mythemes/functions.php加上

```
add_filter( 'the_content_more_link', 'my_more_link', 10, 2 );

function my_more_link( $more_link, $more_link_text ) {
	return str_replace( $more_link_text, 'continue reading ' . get_the_title('', '', false).'...', $more_link );
}
```

wp-content/themes/mythemes/functions.php加上

```
div.entry span.more-link-post {
	color:#36F;
	line-height:25px;
}
div.entry span.more-link-post:hover{
	color:#CCC;
}
```

改成這樣的用意我想應該也只有對SEO有幫助吧…
