在當前主題下的include.php文件里寫代碼。
如果有沒include.php文件,自行創建,并輸入以下代碼
如果存在該文件。修改只需添加Plane_Filter_Plugin_Edit_Response5函數即可。
~~~
<?php
RegisterPlugin("Plane","ActivePlugin_Plane");
function ActivePlugin_Plane() {
Add_Filter_Plugin('Filter_Plugin_Edit_Response5','Plane_Filter_Plugin_Edit_Response5');
}
function Plane_Filter_Plugin_Edit_Response5(){
global $zbp,$article;
echo '<div class="txziduan">';
echo '<table id="nbdiany">
<tr>
<td width="14%">這是字段1</td>
<td>
<input type="text" name="meta_tccptu" value="'.$article->Metas->tccptu.'">
</td>
</tr>
';
echo '</table>';
echo'<br/></div>';
}
~~~
上面代碼中Plane為你主題的ID名,共出現了5次,需要自行修改。
調用的時候,跟其他文章標簽調用方式一樣。
$article.Metas.tccptu
其中tccptu為自定義字段。
如果想添加N多個字段,自行復制<tr>層的內容,然后修改name屬性和value屬性。
- ZBP介紹
- Z-Blog PHP介紹
- 使用協議
- 程序入門
- 環境要求
- 目錄結構
- 安裝指南
- 安裝
- 搬家教程
- 模版結構
- 主題文件構造
- header.php
- index.php
- 404.php
- comment.php
- commentpost.php
- comments.php
- footer.php
- post-istop.php
- post-multi.php
- post-page.php
- post-single.php
- single.php
- include.php
- 模版制作
- 前言
- 主題文件結構
- HTML靜態模板制作
- 開始制作模板
- 制作頭部文件
- 制作底部文件
- 制作文章列表
- 制作文章頁面
- 說明
- 常見問題
- 文章添加新的字段
- 網站分類加文章總數
- 錯誤大全