wordpress post.php,今天把wordpress的post-template.php修改了

为的是把amazon的资料采集到wordpress时发生的摘要令到wordpress的模板错位, 自己记录下, 因为自己还不会编写wordpress的插件,所以先直接改源代码.

位置, wp-includes目录下,

修改内容在post-template.php的129行,改成:

function get_the_content($more_link_text = ‘(more…)’, $stripteaser = 0, $more_file = ”) {

global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow;

$output = ”;

if ( !empty($post->post_password) ) { // if there’s a password

if ( !isset($_COOKIE[‘wp-postpass_’.COOKIEHASH]) || stripslashes($_COOKIE[‘wp-postpass_’.COOKIEHASH]) != $post->post_password ) {    // and it doesn’t match the cookie

$output = get_the_password_form();

return $output;

}

}

if ( $more_file != ” )

$file = $more_file;

else

$file = $pagenow; //$_SERVER[‘PHP_SELF’];

if ( $page > count($pages) ) // if the requested page doesn’t exist

$page = count($pages); // give them the highest numbered page that DOES exist

$content = $pages[$page-1];

if ( preg_match(‘//’, $content, $matches) ) {

$content = explode($matches[0], $content, 2);

if ( !empty($matches[1]) && !empty($more_link_text) )

$more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));

} else {

$content = array($content);

}

if ( (false !== strpos($post->post_content, ‘’) && ((!$multipage) || ($page==1))) )

$stripteaser = 1;

$teaser = $content[0];

if ( ($more) && ($stripteaser) )

$teaser = ”;

$output .= $teaser;

if ( count($content) > 1 ) {

if ( $more ) {

$output .= ‘’.$content[1];

} else {

$output = balanceTags($output);

if ( ! empty($more_link_text) )

$output .= ‘ $more_link_text”;

//2008.7.4 18:24 my edit

$output=str_replace(“”,”

”,$output);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值