2012-04-04 56 views
0

在wordpress中,我有loop.php文件。在那裏我可以看到'閱讀更多'的代碼。我改變了它,它確實在索引頁面上生效。 不過,如果我去../?tag=reference標籤頁我得到的是舊「繼續閱讀」文字,而不是從loop.php如何在wordpress中的所有頁面上更改「閱讀更多」文本

這種「閱讀更多」的編輯的文本是我對loop.php

<div class="entry-content"> 
<?php the_content(__('<span class="read_more">Read More</span>', 'boilerplate')); ?> 
</div><!-- .entry-content --> 

這是我在用的上tag.php

get_template_part('loop', 'tag'); 

但正如我所說的不是得到了「更多」(我得到的索引頁)我SUT得到「繼續閱讀'

我看了一下general-template.php和functions.php,並沒有任何暗示它與讀取更多代碼有關。並且我在google上研究的所有內容都只是指出編輯loop.php文件或者編譯一個新的loop-tag.php文件。我照做了,但結果我一樣:不是歌廳「更多」我得到「繼續閱讀」

感謝您的幫助

回答

0

這真的取決於你的主題和loop.php如何落實到每個主題文件。

但請參閱http://codex.wordpress.org/Customizing_the_Read_More獲取更多幫助。

根據http://wordpress.org/support/topic/theme-boilerplate-excerpt-more-link-customization?replies=3

function volta_setup() { 
    remove_filter('get_the_excerpt', 'boilerplate_custom_excerpt_more'); 
    remove_filter('excerpt_more', 'boilerplate_auto_excerpt_more'); 
} 

add_action('after_setup_theme', 'volta_setup'); 
+0

它的樣板主題 – aurel 2012-04-05 02:15:06

0

我這個混亂的行爲戰鬥之前。當您使用<!--more-->標籤時,Wordpress會以不同的方式處理摘錄,而在編輯帖子時使用摘錄字段。

如果示例中檢測到<!--more-->標記,the_content()將僅包含使用示例中的「Read more」文本。

查看Codex瞭解更多詳情。 http://codex.wordpress.org/Customizing_the_Read_More

編輯:哎呀,@markratledge已經指出你在正確的方向。

0

這可能不是最好的做法,但在我的情況下,它解決了這個問題...

<script> 
jQuery(document).ready(function() { 
jQuery(".read_more").text("Change me"); 
}); 
</script> 

Source - 基於DIVI主題的更多按鈕