{"id":3823,"date":"2025-06-12T05:04:11","date_gmt":"2025-06-11T21:04:11","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3823.html"},"modified":"2025-06-12T05:04:11","modified_gmt":"2025-06-11T21:04:11","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-wordpress-%e4%b8%ad%e8%bd%ac%e6%8d%a2%e8%87%aa%e5%ae%9a%e4%b9%89%e6%96%87%e7%ab%a0%e7%b1%bb%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3823.html","title":{"rendered":"\u5982\u4f55\u5728 WordPress \u4e2d\u8f6c\u6362\u81ea\u5b9a\u4e49\u6587\u7ae0\u7c7b\u578b"},"content":{"rendered":"<div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--1\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/dyA-1-400x300.jpg\" alt=\"Bug&#32534;&#35793;&#29422;\" class=\"wp-image-1842\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">Bug&#32534;&#35793;&#29422;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#22312;WordPress&#20013;&#65292;&#20320;&#21487;&#20197;&#36890;&#36807;&#20462;&#25913;<code>functions.php<\/code>&#25991;&#20214;&#25110;&#20351;&#29992;&#25554;&#20214;&#26469;&#23454;&#29616;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#36716;&#25442;&#12290;&#19979;&#38754;&#25105;&#23558;&#35814;&#32454;&#20171;&#32461;&#36825;&#20010;&#36807;&#31243;&#65292;&#24182;&#25552;&#20379;&#19968;&#20010;&#31616;&#21333;&#30340;&#31034;&#20363;&#12290;<\/p>\n<h3>&#27493;&#39588; 1: &#21019;&#24314;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;<\/h3>\n<p>&#39318;&#20808;&#65292;&#22312;&#20320;&#30340;&#20027;&#39064;&#30446;&#24405;&#19979;&#30340;<code>functions.php<\/code>&#25991;&#20214;&#20013;&#28155;&#21152;&#20197;&#19979;&#20195;&#30721;&#65306;<\/p>\n<pre><code class=\"language-php\">function custom_post_type() {\n    $labels = array(\n        'name'               =&gt; _x( 'Custom Posts', 'Post Type General Name', 'text_domain' ),\n        'singular_name'      =&gt; _x( 'Custom Post', 'Post Type Singular Name', 'text_domain' ),\n        \/\/ &#20854;&#20182;&#26631;&#31614;&#20449;&#24687;...\n    );\n    $args = array(\n        'label'                 =&gt; __( 'Custom Post', 'text_domain' ),\n        'description'           =&gt; __( 'Description of Custom Post', 'text_domain' ),\n        'public'                =&gt; true,\n        'private'               =&gt; false,\n        'exclude_from_search'   =&gt; false,\n        'show_in_nav_menus'     =&gt; true,\n        'capability_type'       =&gt; 'post',\n        'map_meta_cap'          =&gt; true,\n        'hierarchical'          =&gt; false,\n        'rewrite'               =&gt; array( 'slug' =&gt; 'custom-post-type', 'with_front' =&gt; false ),\n        'supports'              =&gt; array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n    );\n    register_post_type( 'custom_post', $args );\n}\nadd_action( 'init', 'custom_post_type' );<\/code><\/pre>\n<p>&#36825;&#27573;&#20195;&#30721;&#20250;&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;<code>custom_post<\/code>&#65292;&#24182;&#35774;&#32622;&#20854;&#25551;&#36848;&#21644;&#25903;&#25345;&#30340;&#36873;&#39033;&#12290;<\/p>\n<h3>&#27493;&#39588; 2: &#23450;&#20041;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#25968;&#25454;&#32467;&#26500;<\/h3>\n<p>&#25509;&#19979;&#26469;&#65292;&#20320;&#38656;&#35201;&#21019;&#24314;&#19968;&#20010;&#25968;&#25454;&#32467;&#26500;&#26469;&#23384;&#20648;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#20449;&#24687;&#12290;&#36825;&#36890;&#24120;&#28041;&#21450;&#21019;&#24314;&#19968;&#20010;&#25968;&#25454;&#24211;&#34920;&#21644;&#19968;&#20123;&#20851;&#32852;&#23383;&#27573;&#12290;<\/p>\n<h4>&#25968;&#25454;&#24211;&#34920;&#21019;&#24314;<\/h4>\n<p>&#22312;&#20320;&#30340;WordPress&#25968;&#25454;&#24211;&#20013;&#21019;&#24314;&#19968;&#20010;&#21517;&#20026;<code>wp_custom_post_types<\/code>&#30340;&#34920;&#65292;&#21487;&#20197;&#20351;&#29992;SQL&#35821;&#21477;&#26469;&#23436;&#25104;&#65306;<\/p>\n<pre><code class=\"language-sql\">CREATE TABLE `wp_custom_post_types` (\n  `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,\n  `post_type` varchar(255) NOT NULL DEFAULT '',\n  `post_parent` bigint(20) NOT NULL DEFAULT '0',\n  `post_author` int(11) NOT NULL DEFAULT '0',\n  `post_title` varchar(255) NOT NULL DEFAULT '',\n  `post_content` longtext NOT NULL,\n  `post_status` varchar(20) NOT NULL DEFAULT 'publish',\n  `comment_status` varchar(20) NOT NULL DEFAULT 'open',\n  `ping_status` varchar(20) NOT NULL DEFAULT 'open',\n  `post_password` varchar(255) NOT NULL DEFAULT '',\n  `post_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n  `post_date_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n  `post_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n  `post_modified_gmt` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\n  `post_excerpt` longtext NOT NULL,\n  `post_mime_type` varchar(100) NOT NULL DEFAULT '',\n  `guid` varchar(255) NOT NULL DEFAULT '',\n  PRIMARY KEY (`ID`),\n  UNIQUE KEY `slug` (`post_slug`)\n);<\/code><\/pre>\n<p>&#27880;&#24847;&#65306;&#36825;&#37324;&#30340;<code>post_slug<\/code>&#23383;&#27573;&#29992;&#20110;&#23384;&#20648;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#21517;&#31216;&#65288;&#20363;&#22914;<code>custom-post-type<\/code>&#65289;&#65292;&#36825;&#26679;&#21487;&#20197;&#26041;&#20415;&#22320;&#22312;&#21518;&#21488;&#31649;&#29702;&#20013;&#25214;&#21040;&#23427;&#12290;<\/p>\n<h3>&#27493;&#39588; 3: &#26356;&#26032;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#25968;&#25454;<\/h3>\n<p>&#29616;&#22312;&#65292;&#20320;&#38656;&#35201;&#26356;&#26032;&#20320;&#30340;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#25968;&#25454;&#32467;&#26500;&#20197;&#36866;&#24212;&#26032;&#30340;&#25968;&#25454;&#24211;&#34920;&#12290;&#20320;&#21487;&#20197;&#32534;&#20889;&#19968;&#20010;&#20989;&#25968;&#26469;&#33258;&#21160;&#25191;&#34892;&#36825;&#20123;&#25805;&#20316;&#12290;<\/p>\n<pre><code class=\"language-php\">function update_custom_post_data() {\n    global $wpdb;\n\n    $table_name = $wpdb-&gt;prefix . \"custom_post_types\";\n\n    $posts = get_posts(array('post_type' =&gt; 'custom_post'));\n\n    foreach ($posts as $post) {\n        $data = array(\n            'post_title' =&gt; $post-&gt;post_title,\n            'post_content' =&gt; $post-&gt;post_content,\n            'post_status' =&gt; 'publish',\n            'post_date' =&gt; date(\"Y-m-d H:i:s\"),\n            'post_date_gmt' =&gt; date(\"Y-m-d G:i:s\"),\n            'post_modified' =&gt; date(\"Y-m-d H:i:s\"),\n            'post_modified_gmt' =&gt; date(\"Y-m-d G:i:s\")\n        );\n\n        $wpdb-&gt;insert($table_name, $data);\n    }\n}\nadd_action('after_setup_theme', 'update_custom_post_data');<\/code><\/pre>\n<p>&#36825;&#27573;&#20195;&#30721;&#20250;&#22312;WordPress&#23433;&#35013;&#23436;&#25104;&#21518;&#33258;&#21160;&#36816;&#34892;&#65292;&#23558;&#25152;&#26377;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#24086;&#23376;&#25968;&#25454;&#25554;&#20837;&#21040;&#26032;&#21019;&#24314;&#30340;&#25968;&#25454;&#24211;&#34920;&#20013;&#12290;<\/p>\n<h3>&#25928;&#26524;&#39564;&#35777;<\/h3>\n<p>&#35201;&#39564;&#35777;&#26159;&#21542;&#25104;&#21151;&#21019;&#24314;&#20102;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#21450;&#20854;&#30456;&#20851;&#25968;&#25454;&#65292;&#35831;&#35775;&#38382;&#20320;&#30340;WordPress&#21518;&#21488;&#65292;&#23548;&#33322;&#33267;&ldquo;&#32534;&#36753;&rdquo; -&gt; &ldquo;&#25991;&#31456;&rdquo;&#65292;&#28982;&#21518;&#36873;&#25321;&ldquo;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&rdquo;&#12290;&#20320;&#24212;&#35813;&#33021;&#30475;&#21040;&#20320;&#30340;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#21015;&#34920;&#65292;&#20197;&#21450;&#35813;&#31867;&#22411;&#30340;&#25152;&#26377;&#24050;&#21457;&#24067;&#24086;&#23376;&#12290;<\/p>\n<h3>&#27880;&#24847;&#20107;&#39033;<\/h3>\n<ul>\n<li>&#30830;&#20445;&#20320;&#30340;&#25968;&#25454;&#24211;&#34920;&#21517;&#19982;&#19978;&#38754;&#30340;SQL&#35821;&#21477;&#20013;&#30340;<code>$table_name<\/code>&#21305;&#37197;&#12290;<\/li>\n<li>&#26681;&#25454;&#20320;&#30340;&#38656;&#27714;&#35843;&#25972;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#30340;&#25968;&#25454;&#32467;&#26500;&#21644;&#21151;&#33021;&#12290;<\/li>\n<\/ul>\n<p>&#20197;&#19978;&#27493;&#39588;&#35814;&#32454;&#20171;&#32461;&#20102;&#22914;&#20309;&#22312;WordPress&#20013;&#21019;&#24314;&#12289;&#31649;&#29702;&#21644;&#26356;&#26032;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#12290;&#24076;&#26395;&#36825;&#23545;&#24744;&#26377;&#25152;&#24110;&#21161;&#65281;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div><div class=\"wp-block-columns p-0 border is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-columns px-4 py-3 border-bottom has-background is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\" style=\"background:linear-gradient(243deg,rgb(238,238,238) 0%,rgba(58,166,242,0.15) 100%)\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<div class=\"wp-block-group is-nowrap is-layout-flex wp-container-core-group-is-layout-6c531013 wp-block-group-is-layout-flex\">\r\n<figure class=\"wp-block-image size-thumbnail is-resized is-style-rounded is-style-rounded--2\"><img decoding=\"async\" src=\"https:\/\/www.zhaozhao123.cn\/myitems\/images\/sites16\/2025\/06\/zp-400x300.jpg\" alt=\"&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;\" class=\"wp-image-1849\" style=\"object-fit:cover;width:30px;height:30px\"><\/figure>\r\n\r\n\r\n\r\n<p class=\"my-0\">&#40657;&#26495;&#21069;&#30340;Bug&#35821;&#27861;&#35762;&#24072;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n<div class=\"wp-block-columns px-xl-5 px-4 py-xl-4 py-3 is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex\">\r\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\r\n<p>&#22312; WordPress &#20013;&#36716;&#25442;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#26159;&#19968;&#31181;&#24120;&#35265;&#30340;&#38656;&#27714;&#65292;&#29305;&#21035;&#26159;&#24403;&#38656;&#35201;&#20026;&#19981;&#21516;&#30340;&#39029;&#38754;&#25110;&#20998;&#31867;&#21019;&#24314;&#26032;&#30340;&#25991;&#31456;&#31867;&#22411;&#26102;&#12290;&#19979;&#38754;&#23558;&#35814;&#32454;&#20171;&#32461;&#22914;&#20309;&#23454;&#29616;&#36825;&#19968;&#25805;&#20316;&#12290;<\/p>\n<h3>1. &#29702;&#35299;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;<\/h3>\n<p>&#39318;&#20808;&#65292;&#25105;&#20204;&#38656;&#35201;&#29702;&#35299;&#20160;&#20040;&#26159;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#65288;Custom Post Type&#65289;&#12290;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#20801;&#35768;&#20320;&#22312; WordPress &#30340;&#20027;&#39064;&#20013;&#21019;&#24314;&#19968;&#20010;&#29420;&#29305;&#30340;&#25991;&#31456;&#26684;&#24335;&#65292;&#36825;&#20123;&#26684;&#24335;&#21487;&#20197;&#26377;&#29305;&#23450;&#30340;&#26631;&#39064;&#12289;&#25551;&#36848;&#21644;&#26631;&#31614;&#31561;&#23646;&#24615;&#12290;&#36890;&#36807;&#35774;&#32622;&#36866;&#24403;&#30340;&#36873;&#39033;&#65292;&#20320;&#21487;&#20197;&#25511;&#21046;&#27599;&#20010;&#25991;&#31456;&#31867;&#22411;&#30340;&#22806;&#35266;&#12289;&#34892;&#20026;&#21644;&#21151;&#33021;&#12290;<\/p>\n<h3>2. &#21019;&#24314;&#26032;&#25991;&#31456;&#31867;&#22411;<\/h3>\n<p>&#35201;&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#65292;&#20320;&#38656;&#35201;&#36981;&#24490;&#20197;&#19979;&#27493;&#39588;&#65306;<\/p>\n<h4>A. &#30331;&#24405;&#21040; WordPress &#25511;&#21046;&#21488;<\/h4>\n<ul>\n<li>&#25171;&#24320;&#27983;&#35272;&#22120;&#24182;&#23548;&#33322;&#33267; <a href=\"https:\/\/www.zhaozhao123.cn\/skin\/go?url=aHR0cHM6Ly95b3VyZG9tYWluLmNvbS93cC1hZG1pbg==\" rel=\"noopener noreferrer nofollow\">https:\/\/yourdomain.com\/wp-admin<\/a><\/li>\n<li>&#36755;&#20837;&#29992;&#25143;&#21517;&#21644;&#23494;&#30721;&#20197;&#30331;&#24405;&#12290;<\/li>\n<li>&#22312;&#24038;&#20391;&#33756;&#21333;&#20013;&#36873;&#25321;&ldquo;&#31649;&#29702;&rdquo; &gt; &ldquo;&#20027;&#39064;&rdquo;&#12290;<\/li>\n<\/ul>\n<h4>B. &#28155;&#21152;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;<\/h4>\n<ol>\n<li>\n<p><strong>&#28857;&#20987;&ldquo;&#28155;&#21152;&#26032;&#20027;&#39064;&rdquo;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#20174;&ldquo;&#32534;&#36753;&#20027;&#39064;&rdquo;&#38754;&#26495;&#20013;&#25214;&#21040;&ldquo;Add New Theme&rdquo;&#25353;&#38062;&#65292;&#28982;&#21518;&#28857;&#20987;&#23427;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#35774;&#32622;&#26032;&#25991;&#31456;&#31867;&#22411;&#21517;&#31216;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#22635;&#20889;&#19968;&#20010;&#20855;&#20307;&#30340;&#21517;&#31216;&#65292;&#22914;&ldquo;&#20851;&#20110;&#25105;&#20204;&rdquo;&#25110;&ldquo;&#26368;&#26032;&#26032;&#38395;&rdquo;&#12290;&#30830;&#20445;&#36825;&#20010;&#21517;&#31216;&#19982;&#23454;&#38469;&#30340;&#20869;&#23481;&#30456;&#21305;&#37197;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#36873;&#25321;&#25991;&#31456;&#31867;&#22411;&#25152;&#23646;&#30340;&#20027;&#39064;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#36873;&#20013;&ldquo;&#40664;&#35748;&#20027;&#39064;&rdquo;&#26469;&#20351;&#29992;&#40664;&#35748;&#20027;&#39064;&#65292;&#25110;&#32773;&#36873;&#25321;&#20854;&#20182;&#20027;&#39064;&#20197;&#26356;&#25913;&#20027;&#39064;&#26679;&#24335;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#35774;&#32622;&#25991;&#31456;&#31867;&#22411;&#36873;&#39033;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#25353;&#29031;&#20320;&#30340;&#38656;&#27714;&#35774;&#32622;&#25991;&#31456;&#31867;&#22411;&#30340;&#23646;&#24615;&#65292;&#21253;&#25324;&#26631;&#39064;&#12289;&#25551;&#36848;&#12289;&#31867;&#21035;&#12289;&#20851;&#38190;&#35789;&#31561;&#12290;<\/li>\n<li>&#23545;&#20110;&#26631;&#39064;&#21644;&#25551;&#36848;&#65292;&#20320;&#21487;&#20197;&#36873;&#25321;&#25991;&#26412;&#23383;&#27573;&#25110;&#36873;&#25321;&#22120;&#12290;&#23545;&#20110;&#31867;&#21035;&#21644;&#20851;&#38190;&#35789;&#65292;&#21017;&#21487;&#20197;&#36890;&#36807;&#35774;&#32622;&#23427;&#20204;&#30340;&#20540;&#26469;&#23436;&#25104;&#12290;<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>&#20445;&#23384;&#35774;&#32622;<\/strong>&#65306;<\/p>\n<ul>\n<li>&#23436;&#25104;&#25152;&#26377;&#35774;&#32622;&#21518;&#65292;&#28857;&#20987;&ldquo;Save Changes&rdquo;&#20197;&#20445;&#23384;&#35774;&#32622;&#12290;<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>3. &#27979;&#35797;&#26032;&#25991;&#31456;&#31867;&#22411;<\/h3>\n<p>&#29616;&#22312;&#65292;&#20320;&#30340;&#26032;&#25991;&#31456;&#31867;&#22411;&#24050;&#32463;&#25104;&#21151;&#21019;&#24314;&#20102;&#12290;&#20026;&#20102;&#27979;&#35797;&#23427;&#26159;&#21542;&#27491;&#30830;&#24037;&#20316;&#65292;&#20320;&#21487;&#20197;&#36825;&#26679;&#20570;&#65306;<\/p>\n<ol>\n<li><strong>&#26597;&#30475;&#25991;&#31456;&#31867;&#22411;<\/strong>&#65306;&#22312; WordPress &#20027;&#39064;&#30340;&ldquo;&#21518;&#21488;&rdquo;&#20013;&#65292;&#36716;&#21040;&ldquo;&#31649;&#29702;&rdquo; &gt; &ldquo;&#25991;&#31456;&#31867;&#22411;&rdquo; &gt; &#20320;&#21018;&#21018;&#21019;&#24314;&#30340;&#26032;&#25991;&#31456;&#31867;&#22411;&#12290;<\/li>\n<li><strong>&#28155;&#21152;&#25991;&#31456;<\/strong>&#65306;&#28857;&#20987;&ldquo;&#26032;&#24314;&#25991;&#31456;&rdquo;&#65292;&#36755;&#20837;&#19968;&#20123;&#27491;&#25991;&#20869;&#23481;&#65292;&#24182;&#23558;&#20854;&#20445;&#23384;&#12290;<\/li>\n<\/ol>\n<h3>4. &#36716;&#25442;&#29616;&#26377;&#25991;&#31456;&#31867;&#22411;<\/h3>\n<p>&#22914;&#26524;&#20320;&#24076;&#26395;&#23558;&#29616;&#26377;&#30340;&#25991;&#31456;&#31867;&#22411;&#36716;&#25442;&#20026;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#65292;&#21482;&#38656;&#25353;&#29031;&#19978;&#36848;&#27493;&#39588;&#65292;&#20294;&#36825;&#27425;&#20320;&#20250;&#30475;&#21040;&ldquo;&#32534;&#36753;&#25991;&#31456;&#31867;&#22411;&rdquo;&#32780;&#19981;&#26159;&ldquo;&#28155;&#21152;&#26032;&#25991;&#31456;&#31867;&#22411;&rdquo;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<p>&#20551;&#35774;&#25105;&#20204;&#26377;&#19968;&#20010;&#21517;&#20026;&ldquo;&#20851;&#20110;&#25105;&#20204;&rdquo;&#30340;&#25991;&#31456;&#31867;&#22411;&#65292;&#20854;&#23646;&#24615;&#22914;&#19979;&#65306;<\/p>\n<pre><code class=\"language-php\">function custom_post_type_customizer( $wp_customize ) {\n    $post_types = array(\n        'about' =&gt; array(\n            'label' =&gt; '&#20851;&#20110;',\n            'public' =&gt; true,\n            'show_ui' =&gt; true,\n            'capabilities' =&gt; array('edit_posts', 'edit_pages'),\n            'hierarchical' =&gt; false,\n            'menu_position' =&gt; null,\n            'menu_icon' =&gt; 'dashicons-editor-bold',\n            'has_archive' =&gt; true,\n            'description' =&gt; esc_html__( 'About page.', 'custom-post-type' ),\n            'rewrite' =&gt; array( 'slug' =&gt; 'about' ),\n            'labels' =&gt; array(\n                'name'               =&gt; esc_html__( '&#20851;&#20110;&#25105;&#20204;', 'custom-post-type' ),\n                'singular_name'      =&gt; esc_html__( '&#20851;&#20110;&#25105;&#20204;', 'custom-post-type' ),\n                'add_new'            =&gt; esc_html__( '&#28155;&#21152;&#26032;&#26465;&#30446;', 'custom-post-type' ),\n                'add_new_item'       =&gt; esc_html__( '&#28155;&#21152;&#26032;&#26465;&#30446;', 'custom-post-type' ),\n                'edit_item'          =&gt; esc_html__( '&#32534;&#36753;&#26465;&#30446;', 'custom-post-type' ),\n                'new_item'           =&gt; esc_html__( '&#26032;&#26465;&#30446;', 'custom-post-type' ),\n                'view_item'          =&gt; esc_html__( '&#26597;&#30475;&#26465;&#30446;', 'custom-post-type' ),\n                'search_items'       =&gt; esc_html__( '&#25628;&#32034;&#26465;&#30446;', 'custom-post-type' ),\n                'not_found'          =&gt; esc_html__( '&#26410;&#25214;&#21040;&#26465;&#30446;', 'custom-post-type' ),\n                'not_found_in_trash' =&gt; esc_html__( '&#26410;&#25214;&#21040;&#26465;&#30446; ( &#21024;&#38500; )', 'custom-post-type' ),\n                'parent_item_colon'  =&gt; '',\n                'all_items'          =&gt; esc_html__( '&#20840;&#37096;&#26465;&#30446;', 'custom-post-type' ),\n                'view_item_link'     =&gt; esc_html__( '&#26597;&#30475;&#26465;&#30446;&#38142;&#25509;', 'custom-post-type' ),\n                'menu_name'          =&gt; esc_html__( '&#20851;&#20110;', 'custom-post-type' )\n            ),\n        ),\n    );\n\n    \/\/ Register post type.\n    $wp_customize-&gt;register_post_type( 'about', $post_types );\n}<\/code><\/pre>\n<p>&#22312;&#36825;&#20010;&#20363;&#23376;&#20013;&#65292;&#25105;&#20204;&#23558; &#8220;&#20851;&#20110;&#25105;&#20204;&#8221; &#31867;&#22411;&#20316;&#20026;&#33258;&#23450;&#20041;&#25991;&#31456;&#31867;&#22411;&#12290;&#25509;&#19979;&#26469;&#65292;&#20320;&#21487;&#20197;&#20687;&#21019;&#24314;&#20219;&#20309;&#20854;&#20182;&#25991;&#31456;&#31867;&#22411;&#19968;&#26679;&#20351;&#29992;&#23427;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; &#22312;WordPress&#20013;&#65292;&#20320;&#21487;&#20197;&#36890;&#36807;&#20462;&#25913;functions.php&#25991;&#20214;&#25110;&#038;#2035..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2107,2106],"tuisongtax":[],"class_list":["post-3823","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-cjyy","tag-cjzn"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/comments?post=3823"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3823\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3823"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}