使用教程
1、首先在子比主题目录的 functions.php
里面加入以下代码:
//微语页面
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
文件中即可。
注:微语头像只需把代码中”https://q1.qlogo.cn/g?b=qq&nk=3371619613&s=640″修改成自己QQ号头像或者自己图片链接即可。
3、最后在后台 >> 页面 >> 新建页面 >> 找到“页面属性”选择“微语页面” >> 填写标题 >> 发布就可以啦!
![图片[1]-子比主题添加微语页面-百义网创交流社区](http://xiaocheng.xjbywl.com/wp-content/uploads/2024/05/image-2-1024x860.png)
发表微语
发表微语只需在后台 >> 微语 >> 发表微语,然后发表自己喜欢的微语即可。
![图片[2]-子比主题添加微语页面-百义网创交流社区](https://img.huliku.com/pic/2022102008180682.png)
© 版权声明
THE END
暂无评论内容