document.writeln('');
在日常生活中,我們常常在自己博客網(wǎng)站發(fā)表自己的一些文章,但我們當想發(fā)表一句簡短的話語時,用文章發(fā)布的話就顯得大材小用了,這時我們就需要一個可以發(fā)表一句話的功能頁面,微語頁面在這時候就起到了一個很好的作用。微語頁面簡單地說就像我們微信的朋友圈那樣,簡單實用。很適合發(fā)一些說說、一句話的感言等。
1、首先在子比主題目錄的functions.php里面加入以下代碼:
//微語add_action(init, my_custom_init); function my_custom_init() { $labels = array( name => 微語, singular_name => singularname, add_new => 發(fā)表微語, add_new_item => 發(fā)表微語, edit_item => 編輯微語, new_item => 新微語, view_item => 查看微語, search_items => 搜索微語, not_found => 暫無微語, not_found_in_trash => 沒有已遺棄的微語, parent_item_colon => , menu_name => 微語 ); $args = array( labels => $labels, public => true, publicly_queryable => true, show_ui => true, show_in_menu => true, query_var => true, rewrite => true, capability_type => post, has_archive => true, hierarchical => false, menu_position => null, supports => array(title,editor,author) ); register_post_type(shuoshuo,$args); }//微語 add_action(init, my_custom_init); function my_custom_init() { $labels = array( name => 微語, singular_name => singularname, add_new => 發(fā)表微語, add_new_item => 發(fā)表微語, edit_item => 編輯微語, new_item => 新微語, view_item => 查看微語, search_items => 搜索微語, not_found => 暫無微語, not_found_in_trash => 沒有已遺棄的微語, parent_item_colon => , menu_name => 微語 ); $args = array( labels => $labels, public => true, publicly_queryable => true, show_ui => true, show_in_menu => true, query_var => true, rewrite => true, capability_type => post, has_archive => true, hierarchical => false, menu_position => null, supports => array(title,editor,author) ); register_post_type(shuoshuo,$args); }//微語add_action(init, my_custom_init); function my_custom_init() { $labels = array( name => 微語, singular_name => singularname, add_new => 發(fā)表微語, add_new_item => 發(fā)表微語, edit_item => 編輯微語, new_item => 新微語, view_item => 查看微語, search_items => 搜索微語, not_found => 暫無微語, not_found_in_trash => 沒有已遺棄的微語, parent_item_colon => , menu_name => 微語 ); $args = array( labels => $labels, public => true, publicly_queryable => true, show_ui => true, show_in_menu => true, query_var => true, rewrite => true, capability_type => post, has_archive => true, hierarchical => false, menu_position => null, supports => array(title,editor,author) ); register_post_type(shuoshuo,$args); }
2、然后在子比主題pages目錄下新建一個weiyu.php文件,然后把下面代碼放入weiyu.php文件中即可。

3、最后在后臺—>頁面—>新建頁面—>找到“頁面屬性”選擇“微語頁面”—>填寫標題—>發(fā)布就可以啦!
發(fā)表微語
發(fā)表微語只需在后臺—>微語—>發(fā)表微語,然后發(fā)表自己喜歡的微語即可。
說明:因為微語頁面采用主題添加代碼的方式生成的頁面,主題更新后會失效,所以更新主題時請及時備份文件代碼,或者關(guān)注收藏本站。好啦!子比主題添加微語頁面的文章教程到這里就結(jié)束了!