{"id":1959,"date":"2025-06-10T18:20:29","date_gmt":"2025-06-10T10:20:29","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/1959.html"},"modified":"2025-06-10T18:20:29","modified_gmt":"2025-06-10T10:20:29","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-wordpress-%e4%b8%ad%e4%b8%ba%e4%b8%8a%e4%b8%80%e7%af%87%e5%92%8c%e4%b8%8b%e4%b8%80%e7%af%87%e6%96%87%e7%ab%a0%e9%93%be%e6%8e%a5%e6%b7%bb%e5%8a%a0%e7%bc%a9%e7%95%a5%e5%9b%be","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/1959.html","title":{"rendered":"\u5982\u4f55\u5728 WordPress \u4e2d\u4e3a\u4e0a\u4e00\u7bc7\u548c\u4e0b\u4e00\u7bc7\u6587\u7ae0\u94fe\u63a5\u6dfb\u52a0\u7f29\u7565\u56fe"},"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;&#20026;&#19978;&#19968;&#31687;&#21644;&#19979;&#19968;&#31687;&#25991;&#31456;&#30340;&#38142;&#25509;&#28155;&#21152;&#32553;&#30053;&#22270;&#65292;&#21487;&#20197;&#36890;&#36807;&#20197;&#19979;&#27493;&#39588;&#23454;&#29616;&#65306;<\/p>\n<ol>\n<li>\n<p>&#39318;&#20808;&#65292;&#22312;<code>functions.php<\/code>&#25991;&#20214;&#20013;&#28155;&#21152;&#22914;&#19979;&#20195;&#30721;&#65306;<\/p>\n<pre><code class=\"language-php\">function add_post_thumbnail_to_previous_next_posts($atts) {\n$atts = shortcode_atts(array(\n    'post_type' =&gt; 'post',\n    'post_id'   =&gt; '',\n    'class'     =&gt; ''\n), $atts, 'previous_next_posts');\n\nif (empty($atts['post_id'])) {\n    return '';\n}\n\nglobal $post;\n$prev_id = get_previous_post($post-&gt;ID);\n$next_id = get_next_post($post-&gt;ID);\n\nif ($prev_id &amp;&amp; !is_null($prev_id)) {\n    echo '&lt;a href=\"' . esc_url(get_permalink($prev_id)) . '\" class=\"prev-post\"&gt;';\n    the_post_thumbnail('thumbnail', array('class' =&gt; 'post-thumbnail'));\n    echo '&lt;\/a&gt;';\n}\n\nif ($next_id &amp;&amp; !is_null($next_id)) {\n    echo '&lt;a href=\"' . esc_url(get_permalink($next_id)) . '\" class=\"next-post\"&gt;';\n    the_post_thumbnail('thumbnail', array('class' =&gt; 'post-thumbnail'));\n    echo '&lt;\/a&gt;';\n}\n\nreturn '';\n}\nadd_shortcode('previous_next_posts', 'add_post_thumbnail_to_previous_next_posts');<\/code><\/pre>\n<\/li>\n<li>\n<p>&#28982;&#21518;&#65292;&#22312;&#24744;&#30340;&#39029;&#38754;&#25110;&#24086;&#23376;&#20869;&#23481;&#21306;&#22495;&#25554;&#20837;&#30701;&#20195;&#30721;&#65306;<\/p>\n<pre><code>[previous_next_posts]<\/code><\/pre>\n<\/li>\n<li>\n<p>&#20026;&#20102;&#20351;&#36825;&#20010;&#21151;&#33021;&#26356;&#30452;&#35266;&#65292;&#24744;&#21487;&#20197;&#23558;&#20854;&#28155;&#21152;&#21040;&#20027;&#39064;&#30340;&#27169;&#26495;&#25991;&#20214;&#65288;&#22914;single.php&#65289;&#20013;&#65292;&#36825;&#26679;&#23427;&#23601;&#20250;&#33258;&#21160;&#20986;&#29616;&#22312;&#27599;&#20010;&#21333;&#39029;&#20013;&#12290;<\/p>\n<\/li>\n<li>\n<p>&#20351;&#29992;&#25928;&#26524;&#65306;&#24403;&#24744;&#35775;&#38382;&#26576;&#20010;&#24086;&#23376;&#26102;&#65292;&#24038;&#20391;&#20250;&#26174;&#31034;&#19978;&#19968;&#31687;&#25991;&#31456;&#30340;&#26631;&#39064;&#12289;&#22270;&#29255;&#21644;&#25688;&#35201;&#65292;&#21491;&#20391;&#21017;&#26174;&#31034;&#19979;&#19968;&#31687;&#25991;&#31456;&#30340;&#26631;&#39064;&#12289;&#22270;&#29255;&#21644;&#25688;&#35201;&#12290;&#36825;&#19981;&#20165;&#22686;&#21152;&#20102;&#32593;&#31449;&#30340;&#25972;&#20307;&#32654;&#35266;&#24230;&#65292;&#20063;&#26041;&#20415;&#29992;&#25143;&#24555;&#36895;&#25214;&#21040;&#30456;&#20851;&#30340;&#20869;&#23481;&#12290;<\/p>\n<\/li>\n<\/ol>\n<p>&#35831;&#27880;&#24847;&#65292;&#36825;&#27573;&#20195;&#30721;&#20551;&#35774;&#24744;&#24050;&#32463;&#23433;&#35013;&#20102;WordPress&#24182;&#29087;&#24713;&#22522;&#26412;&#30340;HTML&#21644;CSS&#30693;&#35782;&#12290;&#22914;&#26524;&#23545;&#36825;&#20123;&#27010;&#24565;&#19981;&#29087;&#24713;&#65292;&#24314;&#35758;&#24744;&#20808;&#23398;&#20064;&#19968;&#19979;&#22522;&#30784;&#25945;&#31243;&#12290;&#27492;&#22806;&#65292;&#30001;&#20110;&#36825;&#26159;&#19968;&#20010;&#31616;&#21333;&#30340;&#21151;&#33021;&#65292;&#22914;&#26524;&#24744;&#24076;&#26395;&#36827;&#19968;&#27493;&#33258;&#23450;&#20041;&#26679;&#24335;&#25110;&#28155;&#21152;&#26356;&#22810;&#30340;&#21151;&#33021;&#65292;&#35831;&#32771;&#34385;&#20351;&#29992;&#31532;&#19977;&#26041;&#25554;&#20214;&#26469;&#25193;&#23637;WordPress&#30340;&#21151;&#33021;&#12290;<\/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;&#65292;&#35201;&#20026;&#19978;&#19968;&#31687;&#21644;&#19979;&#19968;&#31687;&#25991;&#31456;&#38142;&#25509;&#28155;&#21152;&#32553;&#30053;&#22270;&#65292;&#20320;&#21487;&#20197;&#20351;&#29992;&#20197;&#19979;&#27493;&#39588;&#65306;<\/p>\n<h3>&#27493;&#39588; 1: &#21019;&#24314;&#19968;&#20010;&#21253;&#21547;&#32553;&#30053;&#22270;&#30340;&#39029;&#38754;<\/h3>\n<p>&#39318;&#20808;&#65292;&#22312;WordPress&#30340;&#21518;&#21488;&#31649;&#29702;&#30028;&#38754;&#20013;&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#39029;&#38754;&#25110;&#27169;&#26495;&#25991;&#20214;&#12290;<\/p>\n<h3>&#27493;&#39588; 2: &#32534;&#36753;&#39029;&#38754;&#24067;&#23616;<\/h3>\n<p>&#25171;&#24320;&#26032;&#21019;&#24314;&#30340;&#39029;&#38754;&#65292;&#25214;&#21040;&#24182;&#32534;&#36753;<code>&lt;div class=\"entry-content\"&gt;<\/code>&#26631;&#31614;&#20869;&#30340;&#20869;&#23481;&#12290;&#22312;&#36825;&#20010;&#37096;&#20998;&#65292;&#20320;&#20250;&#30475;&#21040;&#19968;&#20123;&#40664;&#35748;&#35774;&#32622;&#65292;&#27604;&#22914;&#26631;&#39064;&#12289;&#20316;&#32773;&#31561;&#20449;&#24687;&#12290;&#22312;&#36825;&#37324;&#65292;&#20320;&#21487;&#20197;&#25554;&#20837;&#19968;&#24352;&#22270;&#29255;&#20316;&#20026;&#32553;&#30053;&#22270;&#12290;<\/p>\n<p>&#20363;&#22914;&#65306;<\/p>\n<pre><code class=\"language-html\">&lt;div class=\"entry-content\"&gt;\n    &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;\/h2&gt;\n    &lt;?php the_content(); ?&gt;\n    &lt;img src=\"&lt;?php echo get_the_post_thumbnail_url(get_the_ID(), 'thumbnail'); ?&gt;\" alt=\"&lt;?php the_title(); ?&gt;\"&gt;\n&lt;\/div&gt;<\/code><\/pre>\n<p>&#36825;&#27573;&#20195;&#30721;&#23558;&#26174;&#31034;&#25991;&#31456;&#30340;&#26631;&#39064;&#20197;&#21450;&#30456;&#24212;&#30340;&#32553;&#30053;&#22270;&#12290;<\/p>\n<h3>&#27493;&#39588; 3: &#22312;&#25991;&#31456;&#20869;&#23481;&#21306;&#22495;&#28155;&#21152;&#38142;&#25509;<\/h3>\n<p>&#25509;&#19979;&#26469;&#65292;&#20320;&#38656;&#35201;&#22312;&#25991;&#31456;&#30340;&#20869;&#23481;&#37096;&#20998;&#28155;&#21152;&#19968;&#20010;&#38142;&#25509;&#21040;&#35813;&#25991;&#31456;&#30340;&#21069;&#19968;&#31687;&#21644;&#21518;&#19968;&#31687;&#12290;&#36825;&#21487;&#20197;&#36890;&#36807;&#20351;&#29992;&#23884;&#22871;&#21015;&#34920;&#25110;&#32773;&#33258;&#23450;&#20041;HTML&#26469;&#23454;&#29616;&#12290;<\/p>\n<h4>&#20351;&#29992;&#23884;&#22871;&#21015;&#34920;<\/h4>\n<pre><code class=\"language-html\">&lt;ul&gt;\n    &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;\n        &lt;li&gt;&lt;a href=\"&lt;?php the_permalink() ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/li&gt;\n    &lt;?php endwhile; endif; ?&gt;\n&lt;\/ul&gt;<\/code><\/pre>\n<p>&#36825;&#20010;&#20363;&#23376;&#20250;&#22312;&#27599;&#20010;&#25991;&#31456;&#30340;&#26631;&#39064;&#21518;&#38754;&#28155;&#21152;&#19968;&#20010;&#38142;&#25509;&#65292;&#25351;&#21521;&#20854;&#23545;&#24212;&#30340;&#19978;&#19968;&#31687;&#25991;&#31456;&#12290;<\/p>\n<h4>&#20351;&#29992;&#33258;&#23450;&#20041;HTML<\/h4>\n<p>&#22914;&#26524;&#20320;&#24076;&#26395;&#29992;&#25143;&#21487;&#20197;&#28857;&#20987;&#38142;&#25509;&#30452;&#25509;&#36339;&#36716;&#21040;&#30456;&#20851;&#25991;&#31456;&#65292;&#21487;&#20197;&#20351;&#29992;&#20197;&#19979;&#26041;&#27861;&#65306;<\/p>\n<pre><code class=\"language-html\">&lt;a href=\"&lt;?php the_permalink(); ?&gt;\" class=\"prev-post\"&gt;&lt;i class=\"fa fa-chevron-left\"&gt;&lt;\/i&gt;&lt;\/a&gt;\n&lt;a href=\"&lt;?php next_post_link(); ?&gt;\" class=\"next-post\"&gt;&lt;i class=\"fa fa-chevron-right\"&gt;&lt;\/i&gt;&lt;\/a&gt;<\/code><\/pre>\n<p>&#36825;&#37324;&#65292;<code>the_permalink()<\/code>&#20989;&#25968;&#33719;&#21462;&#24403;&#21069;&#25991;&#31456;&#30340;URL&#65292;<code>next_post_link()<\/code>&#21017;&#36820;&#22238;&#19979;&#19968;&#20010;&#25991;&#31456;&#30340;&#38142;&#25509;&#12290;<\/p>\n<h3>&#27493;&#39588; 4: &#28155;&#21152;&#33258;&#23450;&#20041;CSS&#26679;&#24335;<\/h3>\n<p>&#20026;&#20102;&#20351;&#38142;&#25509;&#30475;&#36215;&#26469;&#26356;&#21152;&#32654;&#35266;&#65292;&#21487;&#20197;&#22312;HTML&#22836;&#37096;&#28155;&#21152;&#33258;&#23450;&#20041;CSS&#26679;&#24335;&#12290;&#20363;&#22914;&#65306;<\/p>\n<pre><code class=\"language-css\">a {\n    color: #007BFF;\n}\n\n.prev-post, .next-post {\n    text-decoration: none;\n}<\/code><\/pre>\n<p>&#36825;&#20123;&#26679;&#24335;&#21487;&#20197;&#20351;&#38142;&#25509;&#26356;&#20855;&#26377;&#21560;&#24341;&#21147;&#65292;&#21516;&#26102;&#20063;&#31526;&#21512;SEO&#26631;&#20934;&#12290;<\/p>\n<h3>&#27493;&#39588; 5: &#39564;&#35777;&#21151;&#33021;<\/h3>\n<p>&#26368;&#21518;&#65292;&#30830;&#20445;&#20320;&#30340;&#38142;&#25509;&#33021;&#22815;&#27491;&#30830;&#22320;&#36339;&#36716;&#21040;&#30456;&#20851;&#30340;&#25991;&#31456;&#12290;&#21487;&#20197;&#20351;&#29992;&#27983;&#35272;&#22120;&#30340;&#24320;&#21457;&#32773;&#24037;&#20855;&#26597;&#30475;&#38142;&#25509;&#26159;&#21542;&#27491;&#24120;&#24037;&#20316;&#12290;<\/p>\n<p>&#36890;&#36807;&#20197;&#19978;&#27493;&#39588;&#65292;&#20320;&#24212;&#35813;&#33021;&#22815;&#22312;WordPress&#20013;&#25104;&#21151;&#20026;&#25991;&#31456;&#28155;&#21152;&#19978;&#19968;&#31687;&#21644;&#19979;&#19968;&#31687;&#30340;&#25991;&#31456;&#38142;&#25509;&#65292;&#24182;&#28155;&#21152;&#30456;&#24212;&#30340;&#32553;&#30053;&#22270;&#20102;&#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;&#20026;&#19978;&#19968;&#31687;&#21644;&#19979;&#19968;&#31687;&#25991;&#31456;&#30340;&#38142;&#25509;&#038;#2..<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[52,53],"tuisongtax":[],"class_list":["post-1959","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-ztjc","tag-ztmbpzjc"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/1959","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=1959"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/1959\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=1959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=1959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=1959"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=1959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}