
在日常生活中 ,比主我们常常在自己博客网站发表自己的题添一些文章,但我们当想发表一句简短的加微话语时,用文章发布的语页话就显得大材小用了 ,这时我们就需要一个可以发表一句话的比主功能页面,微语页面在这时候就起到了一个很好的题添作用。微语页面简单地说就像我们微信的加微朋友圈那样,简单实用。语页很适合发一些说说、比主一句话的题添感言等 。
美化教程1、加微首先在子比主题目录的语页functions.php里面加入以下代码 :
//微语 add_action(init, my_custom_init); functionmy_custom_init(){ $labels = array(name =>微语, singular_name =>singularname, add_new =>发表微语, add_new_item =>发表微语, 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 => 发表微语, add_new_item => 发表微语, 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 => 发表微语, add_new_item => 发表微语, 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 、最后在后台—>页面—>新建页面—>找到“页面属性”选择“微语页面”—>填写标题—>发布就可以啦!
发表微语
发表微语只需在后台—>微语—>发表微语,然后发表自己喜欢的微语即可 。
说明:因为微语页面采用主题添加代码的方式生成的页面,主题更新后会失效 ,所以更新主题时请及时备份文件代码,或者关注收藏本站。好啦!子比主题添加微语页面的文章教程到这里就结束了 !
内容看完了 © 版权声明 1:本网站名称 :蜡笔傻新2:本站永久网址:https://labishaxin.com/
3:本站部分内容收集于互联网 ,如果有侵权内容、请联系我们删除,不妥之处 ,敬请谅解
4:本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责
5:本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
6:本站资源大多存储在云盘,如发现链接失效 ,请联系我们我们会第一时间更新