{"id":3803,"date":"2025-06-12T04:49:17","date_gmt":"2025-06-11T20:49:17","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3803.html"},"modified":"2025-06-12T04:49:17","modified_gmt":"2025-06-11T20:49:17","slug":"%e5%a6%82%e4%bd%95%e5%85%81%e8%ae%b8%e7%94%a8%e6%88%b7%e4%bb%8e%e4%bd%a0%e7%9a%84wordpress%e6%96%87%e7%ab%a0%e4%b8%ad%e5%88%86%e4%ba%ab%e5%bc%95%e8%af%ad","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3803.html","title":{"rendered":"\u5982\u4f55\u5141\u8bb8\u7528\u6237\u4ece\u4f60\u7684WordPress\u6587\u7ae0\u4e2d\u5206\u4eab\u5f15\u8bed"},"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>&#35201;&#20801;&#35768;&#29992;&#25143;&#20174;&#20320;&#30340;WordPress&#25991;&#31456;&#20013;&#20998;&#20139;&#24341;&#35821;&#65292;&#20320;&#21487;&#20197;&#37319;&#21462;&#20197;&#19979;&#27493;&#39588;&#65306;<\/p>\n<ol>\n<li>\n<p><strong>&#28155;&#21152;&#24341;&#29992;&#21151;&#33021;&#25554;&#20214;<\/strong>&#65306;&#39318;&#20808;&#65292;&#20320;&#38656;&#35201;&#23433;&#35013;&#24182;&#21551;&#29992;&#19968;&#20010;&#25903;&#25345;&#24341;&#29992;&#30340;&#25554;&#20214;&#65292;&#22914;&ldquo;ShareThis&rdquo;&#25110;&ldquo;ShareThis for WordPress&rdquo;&#12290;&#36825;&#20123;&#25554;&#20214;&#21487;&#20197;&#35753;&#20320;&#36731;&#26494;&#22320;&#22312;&#25991;&#31456;&#20013;&#25554;&#20837;&#31038;&#20132;&#20998;&#20139;&#25353;&#38062;&#21644;&#24341;&#35821;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#35774;&#32622;&#20849;&#20139;&#36873;&#39033;<\/strong>&#65306;&#36827;&#20837;&#20320;&#30340;WordPress&#21518;&#21488;&#65292;&#25214;&#21040;&ldquo;ShareThis&rdquo;&#25110;&ldquo;ShareThis for WordPress&rdquo;&#30340;&#35774;&#32622;&#39029;&#38754;&#12290;&#22312;&#36825;&#37324;&#65292;&#20320;&#21487;&#20197;&#35843;&#25972;&#21508;&#31181;&#20998;&#20139;&#35774;&#32622;&#65292;&#21253;&#25324;&#26159;&#21542;&#26174;&#31034;&#20998;&#20139;&#38142;&#25509;&#12289;&#26159;&#21542;&#26174;&#31034;&#31038;&#20132;&#23186;&#20307;&#22270;&#26631;&#31561;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#21019;&#24314;&#24341;&#35821;&#27169;&#26495;<\/strong>&#65306;&#22914;&#26524;&#20320;&#24076;&#26395;&#29992;&#25143;&#21487;&#20197;&#30452;&#25509;&#22797;&#21046;&#24182;&#31896;&#36148;&#24341;&#35821;&#21040;&#20182;&#20204;&#30340;&#24086;&#23376;&#20013;&#65292;&#20320;&#38656;&#35201;&#20026;&#27599;&#20010;&#25991;&#31456;&#21019;&#24314;&#19968;&#20010;&#29305;&#23450;&#30340;&#24341;&#35821;&#27169;&#26495;&#12290;&#36825;&#36890;&#24120;&#28041;&#21450;&#32534;&#36753;&#25991;&#31456;&#30340;&#20869;&#23481;&#20197;&#21253;&#21547;&#19968;&#20010;HTML&#26631;&#35760;&#65292;&#20363;&#22914;<code>&lt;blockquote&gt;<\/code>&#21644;<code>&lt;cite&gt;<\/code>&#26631;&#31614;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#27979;&#35797;&#19982;&#20248;&#21270;<\/strong>&#65306;&#23436;&#25104;&#20197;&#19978;&#27493;&#39588;&#21518;&#65292;&#30830;&#20445;&#23545;&#32593;&#31449;&#19978;&#30340;&#25152;&#26377;&#25991;&#31456;&#37117;&#36827;&#34892;&#20102;&#26356;&#26032;&#65292;&#28982;&#21518;&#26816;&#26597;&#24341;&#35821;&#26159;&#21542;&#27491;&#30830;&#26174;&#31034;&#65292;&#24182;&#19988;&#29992;&#25143;&#33021;&#21542;&#39034;&#21033;&#22320;&#23558;&#20854;&#22797;&#21046;&#21040;&#20854;&#20182;&#24086;&#23376;&#20013;&#12290;<\/p>\n<\/li>\n<\/ol>\n<h3>&#31034;&#20363;&#20195;&#30721;<\/h3>\n<p>&#20551;&#35774;&#25105;&#20204;&#27491;&#22312;&#21046;&#20316;&#19968;&#20010;&#21338;&#23458;&#25991;&#31456;&#65292;&#20854;&#20013;&#21253;&#21547;&#20102;&#24341;&#35821;&#12290;&#20197;&#19979;&#26159;&#21487;&#33021;&#30340;&#20195;&#30721;&#29255;&#27573;&#65306;<\/p>\n<pre><code class=\"language-html\">&lt;!-- &#20351;&#29992;ShareThis&#25554;&#20214;&#25552;&#20379;&#30340;&#20195;&#30721; --&gt;\n&lt;div class=\"sharethis-inline-share-buttons\" data-ssrc=\"tw\"&gt;\n    &lt;a href=\"#\"&gt;Twitter&lt;\/a&gt;\n    &lt;a href=\"#\"&gt;Facebook&lt;\/a&gt;\n    &lt;a href=\"#\"&gt;Google+&lt;\/a&gt;\n    &lt;a href=\"#\"&gt;LinkedIn&lt;\/a&gt;\n&lt;\/div&gt;\n\n&lt;!-- &#25554;&#20837;&#24341;&#35821;&#27169;&#26495; --&gt;\n&lt;p&gt;&lt;strong&gt;&#21407;&#25991;&#65306;&lt;\/strong&gt;&lt;\/p&gt;\n&lt;p&gt;&#36825;&#26159;&#19968;&#20010;&#24341;&#35821;&#30340;&#20363;&#23376;&#12290;&lt;\/p&gt;\n&lt;p&gt;&amp;nbsp;&lt;\/p&gt;<\/code><\/pre>\n<p>&#22312;&#36825;&#20010;&#20363;&#23376;&#20013;&#65306;<\/p>\n<ul>\n<li><code>ShareThis<\/code>&#25554;&#20214;&#34987;&#29992;&#26469;&#28155;&#21152;&#31038;&#20132;&#20998;&#20139;&#25353;&#38062;&#12290;<\/li>\n<li>&#24341;&#35821;&#27169;&#26495;&#36890;&#36807;<code>&lt;strong&gt;<\/code>&#21644;<code>&lt;p&gt;<\/code>&#26631;&#31614;&#26469;&#23454;&#29616;&#65292;&#29992;&#20110;&#22686;&#24378;&#24341;&#35821;&#30340;&#25928;&#26524;&#12290;<\/li>\n<\/ul>\n<h3>&#25928;&#26524;<\/h3>\n<p>&#24403;&#20320;&#28857;&#20987;&#20998;&#20139;&#25353;&#38062;&#26102;&#65292;&#29992;&#25143;&#20250;&#30475;&#21040;&#19968;&#20010;&#21253;&#21547;&#31038;&#20132;&#20998;&#20139;&#38142;&#25509;&#30340;&#24377;&#31383;&#65292;&#20182;&#20204;&#21487;&#20197;&#36873;&#25321;&#20998;&#20139;&#21040;&#19981;&#21516;&#30340;&#24179;&#21488;&#12290;&#22914;&#26524;&#29992;&#25143;&#36873;&#25321;&#20998;&#20139;&#21040;&#26576;&#19968;&#20010;&#24179;&#21488;&#65288;&#27604;&#22914;Twitter&#65289;&#65292;&#37027;&#20040;&#20182;&#20204;&#20250;&#33258;&#21160;&#22797;&#21046;&#24182;&#31896;&#36148;&#20102;&#19968;&#20010;&#21253;&#21547;&#24341;&#35821;&#30340;&#38142;&#25509;&#21040;&#20182;&#20204;&#30340;&#24086;&#23376;&#20013;&#12290;<\/p>\n<p>&#36890;&#36807;&#19978;&#36848;&#26041;&#27861;&#65292;&#20320;&#19981;&#20165;&#33021;&#22815;&#20801;&#35768;&#29992;&#25143;&#20174;&#20320;&#30340;WordPress&#25991;&#31456;&#20013;&#20998;&#20139;&#24341;&#35821;&#65292;&#36824;&#33021;&#25552;&#39640;&#32593;&#31449;&#30340;&#25972;&#20307;&#20114;&#21160;&#24615;&#21644;&#29992;&#25143;&#20307;&#39564;&#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>&#35201;&#23454;&#29616;&#36825;&#20010;&#21151;&#33021;&#65292;&#25105;&#20204;&#38656;&#35201;&#23545;WordPress&#30340;<code>wp_comments.php<\/code>&#25991;&#20214;&#36827;&#34892;&#19968;&#20123;&#20462;&#25913;&#26469;&#22686;&#21152;&#19968;&#20010;&#33258;&#23450;&#20041;&#25554;&#20214;&#30340;&#21151;&#33021;&#12290;&#20197;&#19979;&#26159;&#22914;&#20309;&#23454;&#29616;&#36825;&#19968;&#21151;&#33021;&#30340;&#22522;&#26412;&#27493;&#39588;&#65306;<\/p>\n<h3>&#27493;&#39588; 1: &#20462;&#25913;WordPress&#20027;&#39064;<\/h3>\n<p>&#39318;&#20808;&#65292;&#22312;&#24744;&#30340;WordPress&#20027;&#39064;&#30340;<code>functions.php<\/code>&#25991;&#20214;&#20013;&#28155;&#21152;&#19968;&#20010;&#26032;&#30340;&#20989;&#25968;&#65292;&#29992;&#20110;&#22788;&#29702;&#35780;&#35770;&#20013;&#30340;&#24341;&#29992;&#12290;<\/p>\n<pre><code class=\"language-php\">function wpse26975_custom_quote() {\n    $post_id = get_queried_object_id();\n    if (is_single()) {\n        $post = get_post($post_id);\n        if ($post) {\n            $content = $post-&gt;post_content;\n            $content = str_replace(array('&lt;blockquote&gt;', '&lt;\/blockquote&gt;'), array(' ', ''), $content);\n            $content = preg_replace('\/s+\/u', ' ', $content);\n            $content = trim(preg_replace('\/ns*n\/u', \"n\", $content));\n            $content = preg_replace('\/n{2,}\/', 'nn', $content);\n            $content = preg_replace('\/n\/', '&lt;br&gt;n', $content);\n            $content = preg_replace('\/s+\/', ' ', $content);\n            $content = apply_filters( 'the_content', $content );\n            echo \"&lt;blockquote&gt;{$content}&lt;\/blockquote&gt;\";\n        }\n    }\n}\nadd_action( 'pre_get_posts', 'wpse26975_custom_quote' );<\/code><\/pre>\n<h3>&#27493;&#39588; 2: &#21019;&#24314;&#26032;&#25554;&#20214;<\/h3>\n<p>&#25509;&#19979;&#26469;&#65292;&#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#25554;&#20214;&#25991;&#20214;&#65288;&#20363;&#22914;&#65306;<code>wp-seo-plugin.php<\/code>)&#65292;&#24182;&#23558;&#19978;&#36848;&#20195;&#30721;&#22797;&#21046;&#21040;&#35813;&#25991;&#20214;&#20013;&#12290;<\/p>\n<h3>&#27493;&#39588; 3: &#37197;&#32622;&#25554;&#20214;<\/h3>\n<p>&#23558;&#27492;&#25554;&#20214;&#19978;&#20256;&#33267;WordPress&#20027;&#30446;&#24405;&#19979;&#30340;<code>plugins\/<\/code>&#25991;&#20214;&#22841;&#19979;&#65292;&#28982;&#21518;&#28608;&#27963;&#24182;&#37197;&#32622;&#23427;&#20197;&#20351;&#29992;&#26032;&#30340;&#21151;&#33021;&#12290;<\/p>\n<h3>&#27493;&#39588; 4: &#28155;&#21152;&#21040;WordPress&#35774;&#32622;<\/h3>\n<p>&#20026;&#20102;&#30830;&#20445;&#25554;&#20214;&#21487;&#20197;&#27491;&#24120;&#24037;&#20316;&#65292;&#35831;&#22312;WordPress&#35774;&#32622;&#38754;&#26495;&#20013;&#21551;&#29992;&ldquo;&#33258;&#23450;&#20041;&rdquo;&#36873;&#39033;&#21345;&#65292;&#25214;&#21040;&#24182;&#21246;&#36873;&ldquo;&#33258;&#23450;&#20041;&#25554;&#20214;&rdquo;&#12290;<\/p>\n<h3>&#27493;&#39588; 5: &#27979;&#35797;&#21644;&#37096;&#32626;<\/h3>\n<p>&#29616;&#22312;&#65292;&#24744;&#24212;&#35813;&#33021;&#22815;&#30475;&#21040;&#26469;&#33258;&#29305;&#23450;&#25991;&#31456;&#30340;&#24341;&#35821;&#34987;&#25554;&#20837;&#21040;&#35780;&#35770;&#21306;&#20102;&#12290;<\/p>\n<h3>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h3>\n<h4>&#20351;&#29992;PHP&#32534;&#36753;&#22120;&#32534;&#20889;<\/h4>\n<pre><code class=\"language-php\">&lt;?php\n\n\/**\n * Custom Quote Function for WPSE26975 Plugin.\n *\/\nfunction wpse26975_custom_quote() {\n\n    $post_id = get_queried_object_id();\n    if (is_single()) {\n        $post = get_post($post_id);\n\n        \/\/ Check if the post exists and is single\n        if ($post &amp;&amp; !is_category() &amp;&amp; !is_tag()) {\n            $content = $post-&gt;post_content;\n\n            \/\/ Replace specific patterns in the content\n            $content = str_replace(['&lt;blockquote&gt;', '&lt;\/blockquote&gt;'], [' ', ''], $content);\n            $content = preg_replace('\/s+\/u', ' ', $content);\n            $content = trim(preg_replace('\/ns*n\/u', \"n\", $content));\n            $content = preg_replace('\/n{2,}\/', 'nn', $content);\n            $content = preg_replace('\/n\/', '&lt;br&gt;n', $content);\n            $content = preg_replace('\/s+\/', ' ', $content);\n\n            \/\/ Apply filters on the content\n            $content = apply_filters('the_content', $content);\n\n            \/\/ Output the quote with HTML tags\n            echo '&lt;blockquote&gt;' . htmlspecialchars($content) . '&lt;\/blockquote&gt;';\n        }\n    }\n\n}\n\n\/\/ Register the custom function to use it globally\nadd_action('pre_get_posts', 'wpse26975_custom_quote');\n\n?&gt;<\/code><\/pre>\n<h4>&#20351;&#29992;HTML&#32534;&#36753;&#22120;&#32534;&#20889;<\/h4>\n<pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n&lt;meta charset=\"UTF-8\"&gt;\n&lt;title&gt;Welcome to WordPress&lt;\/title&gt;\n&lt;style type=\"text\/css\"&gt;\nblockquote { margin-bottom: 1em; }\n&lt;\/style&gt;\n&lt;\/head&gt;\n\n&lt;body&gt;\n&lt;div id=\"primary\" class=\"site-content\"&gt;\n&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;\n&lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;\/h2&gt;\n&lt;?php the_content(); ?&gt;\n&lt;?php endwhile; endif; ?&gt;\n&lt;\/div&gt;&lt;!-- #primary --&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<p>&#36890;&#36807;&#36825;&#20123;&#27493;&#39588;&#65292;&#24744;&#21487;&#20197;&#36731;&#26494;&#22320;&#20026;WordPress&#25991;&#31456;&#28155;&#21152;&#24341;&#35821;&#20849;&#20139;&#21151;&#33021;&#12290;&#35831;&#26681;&#25454;&#38656;&#35201;&#35843;&#25972;&#20195;&#30721;&#20197;&#36866;&#24212;&#24744;&#30340;&#20855;&#20307;&#38656;&#27714;&#12290;<\/p>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Bug&#32534;&#35793;&#29422; &#35201;&#20801;&#35768;&#29992;&#25143;&#20174;&#20320;&#30340;WordPress&#25991;&#31456;&#20013;&#20998;&#20139;&#24341;&#35821;&#038;#6..<\/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":[2107,2106],"tuisongtax":[],"class_list":["post-3803","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\/3803","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=3803"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3803\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3803"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}