添加代码
首先在主题的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); }
注意的是有些主题模板不是在functions.php(自行兼容)
新建立文件:weiyu.php
![图片[1]-添加说说/微语功能美化版纯代码加微语-乡野博文](http://www.zau.cn/wp-content/uploads/2022/02/20220217162830-1.png)
代码打包下载好了,需要修改第149行LOGO,
以下为效果图
![图片[2]-添加说说/微语功能美化版纯代码加微语-乡野博文](http://www.zau.cn/wp-content/uploads/2022/02/20220217162830-2.png)
代码下载地址
您阅读这篇文章共花了: 0小时00分00秒
THE END
暂无评论内容