zb博客文章页自定义字段双标题内容

        {php}
        if(!empty($article->Metas->fu_title)){
            $title1 = mb_convert_encoding($article->Metas->fu_title,'HTML-ENTITIES','utf-8');
        }else{
            $title1 = $title;
        }
        {/php}
        <title>{$title1}-{$name}</title>
        <meta name="keywords" content="{$keywords}" />
         <script>if(navigator.userAgent.toLocaleLowerCase().indexOf("baidu") == -1){document.title ="{if $article.Metas.arttitle}{:mb_convert_encoding($article.Metas.arttitle,'HTML-ENTITIES','utf-8')}{else}{$title}{if $zbp->Config('suiranx_air')->cate_switch=="1"}-{$article.Category.Name}{/if}{/if}-{$name}"}</script>
 {php}if($article->Metas->artkeywords){$keywords= mb_convert_encoding($article->Metas->artkeywords,'HTML-ENTITIES','utf-8');}else{$keywords=mb_convert_encoding($keywords,'HTML-ENTITIES','utf-8');}{/php}
<meta name="keywords" content="{$keywords}" />
{php}if($article->Metas->artdescription){$description=mb_convert_encoding($article->Metas->artdescription,'HTML-ENTITIES','utf-8');}else{$description =mb_convert_encoding(preg_replace('/[\r\n\s]+/', ' ', trim(SubStrUTF8(TransferHTML($article->Content,'[nohtml]'),150)).'...'),'HTML-ENTITIES','utf-8');}{/php}
        <meta name="description" content="{SubStrUTF8(TransferHTML($article.Intro,"[nohtml]"),200)}" />

找到对应seo标题更换成这样的代码即可!

  • 找到并修改当前theme下的include.php文件

//注册插件(default为主题名称)
Add_Filter_Plugin('default','zb_c005_futitle');
function zb_c005_futitle(){    	    			    		 	 		     	  		            		 
    global $zbp,$article;
     echo '<p class=""><span style="font-size: 1.1em;font-weight: bold;">副标题:</span><br>
    <input name="meta_fu_title" placeholder="" type="text" style="width:99%;" value="'.$article->Metas->fu_title.'" />
    </p>';
} 
//在需要的地方调用即可
<p>副标题:{$article.Metas.fu_title}</p>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值