I'm importing posts from a Drupal feed that uses <!--break-->
instead of <!--more-->
. I'm thinking that I could scan the content and replace all instances of <!--break-->
with <!--more->
from my functions php, but it seems like there would be an easier way to make the function that is already looking for <!--more-->
validate and trigger off of <!--break-->
as well. Any ideas or other innovative ways that I can trigger the page break from <!--break-->
in Wordpress?
wordpress使用<! - break - >以及<! - more - >
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- dongxin2734 2013-10-08 17:55关注
You can just modify the existing function. open up the
wp-includes/post.php
file. Find theget_extended
function and replaceif ( preg_match('/<!--more(.*?)?-->/', $post, $matches) ) {
with
if ( preg_match('/<!--more(.*?)?-->/', $post, $matches) || preg_match('/<!--break(.*?)?-->/', $post, $matches) ) {
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报