我正在尝试自定义 Word 新闻模板并且遇到了一些麻烦。该页面是http://rexonmedia.com/?page_id=113,每个部分下都有描述,描述中的所有文本都是纯文本(Actionscript,访问站点...)。我希望文本被格式化或具有链接,如源 (http://rexonmedia.com/?portfolio=audiomaya) 和超链接。
我发现这里的罪魁祸首是“strip_tags”标签。它用于两个不同的地方。我尝试了几个场景,但没有奏效。请帮忙
public function customFormat($content,$strip_tags = false,$shortcode=true){
$content = stripslashes($content);
if($shortcode)
$content = do_shortcode( shortcode_unautop( $content ) );
$content = preg_replace('#^<\/p>|^<br\s?\/?>|<p>$|<p>\s*( )?\s*<\/p>#', '', $content);
if($strip_tags)
$content = strip_tags($content,"<hades>,<tabend>");
return $content;
}
<?php
global $more; // Declare global $more (before the loop).
$more = 1;
$content = get_the_content('');
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$this->shortenContent( $content_limit , strip_tags( $content ) );
?>