{"id":3299,"date":"2025-06-11T20:48:05","date_gmt":"2025-06-11T12:48:05","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3299.html"},"modified":"2025-06-11T20:48:05","modified_gmt":"2025-06-11T12:48:05","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8wordpress%e4%b8%ad%e5%88%9b%e5%bb%ba%e6%8e%a8%e8%8d%90%e8%ae%a1%e5%88%92","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3299.html","title":{"rendered":"\u5982\u4f55\u5728WordPress\u4e2d\u521b\u5efa\u63a8\u8350\u8ba1\u5212"},"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;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#26159;&#19968;&#31181;&#38750;&#24120;&#26377;&#29992;&#30340;&#21151;&#33021;&#65292;&#21487;&#20197;&#24110;&#21161;&#24744;&#22686;&#24378;&#32593;&#31449;&#30340;&#29992;&#25143;&#20114;&#21160;&#21644;&#21442;&#19982;&#24230;&#12290;&#20197;&#19979;&#26159;&#22914;&#20309;&#22312;WordPress&#20013;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#30340;&#27493;&#39588;&#65306;<\/p>\n<h3>&#27493;&#39588;1&#65306;&#30331;&#24405;&#21040;&#24744;&#30340;WordPress&#21518;&#21488;<\/h3>\n<p>&#39318;&#20808;&#65292;&#30830;&#20445;&#24744;&#24050;&#30331;&#24405;&#21040;&#24744;&#30340;WordPress&#21518;&#21488;&#31649;&#29702;&#38754;&#26495;&#12290;<\/p>\n<h3>&#27493;&#39588;2&#65306;&#35775;&#38382;&ldquo;&#35774;&#32622;&rdquo;&#36873;&#39033;&#21345;<\/h3>\n<p>&#22312;WordPress&#21518;&#21488;&#39318;&#39029;&#65292;&#28857;&#20987;&#24038;&#19978;&#35282;&#30340;&ldquo;&#35774;&#32622;&rdquo;&#22270;&#26631;&#65292;&#28982;&#21518;&#36873;&#25321;&ldquo;&#25512;&#33616;&#35745;&#21010;&rdquo;&#12290;<\/p>\n<h3>&#27493;&#39588;3&#65306;&#28155;&#21152;&#26032;&#35745;&#21010;<\/h3>\n<p>&#22312;&ldquo;&#25512;&#33616;&#35745;&#21010;&rdquo;&#39029;&#38754;&#65292;&#24744;&#21487;&#20197;&#28155;&#21152;&#26032;&#30340;&#25512;&#33616;&#35745;&#21010;&#12290;&#36755;&#20837;&#35745;&#21010;&#21517;&#31216;&#12289;&#25551;&#36848;&#20197;&#21450;&#24320;&#22987;&#26085;&#26399;&#21644;&#32467;&#26463;&#26085;&#26399;&#12290;<\/p>\n<h3>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h3>\n<pre><code class=\"language-php\">\/\/ &#21019;&#24314;&#19968;&#20010;&#26032;&#30340;&#25512;&#33616;&#35745;&#21010;\nfunction create_new_recommendation_plan() {\n    $plan_name = 'New Recommendation Plan';\n    $description = 'This is a new recommendation plan for your users.';\n    $start_date = date('Y-m-d', strtotime('+7 days'));\n    $end_date = date('Y-m-d', strtotime('+6 months'));\n\n    \/\/ &#25554;&#20837;SQL&#35821;&#21477;&#20197;&#25554;&#20837;&#25512;&#33616;&#35745;&#21010;&#25968;&#25454;\n    global $wpdb;\n    $sql = \"INSERT INTO wp_recommendation_plans (name, description, start_date, end_date) VALUES ('$plan_name', '$description', '$start_date', '$end_date')\";\n    $result = $wpdb-&gt;query($sql);\n\n    if ($result) {\n        echo \"&#25512;&#33616;&#35745;&#21010;&#25104;&#21151;&#21019;&#24314;&#65281;\";\n    } else {\n        echo \"&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#26102;&#21457;&#29983;&#38169;&#35823;&#65292;&#35831;&#26816;&#26597;&#26085;&#24535;&#12290;\";\n    }\n}<\/code><\/pre>\n<h3>&#20351;&#29992;&#27493;&#39588;&#65306;<\/h3>\n<ol>\n<li>&#25171;&#24320;Wordpress&#21518;&#21488;&#12290;<\/li>\n<li>&#36716;&#33267;&ldquo;&#35774;&#32622; &gt; &#25512;&#33616;&#35745;&#21010;&rdquo;&#12290;<\/li>\n<li>&#22635;&#20889;&#25512;&#33616;&#35745;&#21010;&#30340;&#25152;&#26377;&#24517;&#35201;&#20449;&#24687;&#65288;&#21517;&#31216;&#12289;&#25551;&#36848;&#12289;&#24320;&#22987;&#26085;&#26399;&#21644;&#32467;&#26463;&#26085;&#26399;&#65289;&#12290;<\/li>\n<li>&#28857;&#20987;&ldquo;&#20445;&#23384;&#26356;&#25913;&rdquo;&#12290;<\/li>\n<\/ol>\n<h3>&#25928;&#26524;&#35828;&#26126;&#65306;<\/h3>\n<ul>\n<li>&#26032;&#30340;&#25512;&#33616;&#35745;&#21010;&#23558;&#22312;WordPress&#25968;&#25454;&#24211;&#20013;&#35760;&#24405;&#19979;&#26469;&#65292;&#36825;&#26679;&#24403;&#29992;&#25143;&#27983;&#35272;&#35813;&#32593;&#31449;&#26102;&#65292;&#20182;&#20204;&#21487;&#33021;&#20250;&#30475;&#21040;&#25512;&#33616;&#38142;&#25509;&#25110;&#20869;&#23481;&#26469;&#20419;&#36827;&#36827;&#19968;&#27493;&#30340;&#27963;&#21160;&#25110;&#36141;&#20080;&#34892;&#20026;&#12290;<\/li>\n<li>&#36890;&#36807;&#35774;&#32622;&#21512;&#29702;&#30340;&#25512;&#33616;&#26399;&#38480;&#65292;&#21487;&#20197;&#28608;&#21169;&#29992;&#25143;&#37319;&#21462;&#34892;&#21160;&#65292;&#20174;&#32780;&#25552;&#39640;&#32593;&#31449;&#30340;&#36716;&#21270;&#29575;&#12290;<\/li>\n<\/ul>\n<p>&#20197;&#19978;&#23601;&#26159;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#30340;&#22522;&#26412;&#27969;&#31243;&#21644;&#31034;&#20363;&#20195;&#30721;&#65292;&#24076;&#26395;&#23545;&#24744;&#26377;&#25152;&#24110;&#21161;&#65281;&#22914;&#26524;&#24744;&#26377;&#20219;&#20309;&#20854;&#20182;&#38382;&#39064;&#65292;&#35831;&#38543;&#26102;&#25552;&#38382;&#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;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#26159;&#19968;&#31181;&#38750;&#24120;&#26377;&#29992;&#30340;&#31574;&#30053;&#65292;&#21487;&#20197;&#24110;&#21161;&#24744;&#25552;&#39640;&#32593;&#31449;&#27969;&#37327;&#21644;&#36716;&#21270;&#29575;&#12290;&#20197;&#19979;&#26159;&#22914;&#20309;&#22312;WordPress&#20013;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#30340;&#19968;&#33324;&#27493;&#39588;&#65306;<\/p>\n<ol>\n<li>\n<p><strong>&#35774;&#32622;&#25512;&#33616;&#35745;&#21010;<\/strong>&#65306;&#39318;&#20808;&#65292;&#22312;&#24744;&#30340;WordPress&#20027;&#39064;&#25110;&#25554;&#20214;&#20013;&#28155;&#21152;&#19968;&#20010;&ldquo;&#25512;&#33616;&rdquo;&#21151;&#33021;&#12290;&#36825;&#21487;&#20197;&#36890;&#36807;&#20351;&#29992;WordPress&#25552;&#20379;&#30340;&#33258;&#23450;&#20041;&#21151;&#33021;&#26469;&#23454;&#29616;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#35774;&#35745;&#25512;&#33616;&#39029;&#38754;<\/strong>&#65306;&#20026;&#25512;&#33616;&#35745;&#21010;&#35774;&#35745;&#19968;&#20010;&#28165;&#26224;&#12289;&#31616;&#27905;&#30340;&#39029;&#38754;&#65292;&#20197;&#21560;&#24341;&#29992;&#25143;&#24182;&#40723;&#21169;&#20182;&#20204;&#21442;&#19982;&#12290;&#24744;&#21487;&#20197;&#20351;&#29992;WordPress&#20869;&#32622;&#30340;&#27169;&#26495;&#24341;&#25806;&#25110;&#32773;&#20351;&#29992;&#20854;&#20182;&#31532;&#19977;&#26041;&#25554;&#20214;&#65288;&#22914;Elementor, Beaver Builder&#31561;&#65289;&#26469;&#26500;&#24314;&#25512;&#33616;&#39029;&#38754;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#36873;&#25321;&#25512;&#33616;&#21830;&#21697;<\/strong>&#65306;&#30830;&#20445;&#24744;&#36873;&#25321;&#30340;&#21830;&#21697;&#19982;&#24744;&#30340;&#30446;&#26631;&#21463;&#20247;&#30456;&#20851;&#12290;&#24744;&#21487;&#20197;&#20174;&#24744;&#30340;&#20135;&#21697;&#30446;&#24405;&#20013;&#31579;&#36873;&#20986;&#26368;&#36866;&#21512;&#25512;&#33616;&#30340;&#21830;&#21697;&#65292;&#24182;&#23558;&#23427;&#20204;&#28155;&#21152;&#21040;&#25512;&#33616;&#21015;&#34920;&#20013;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#35774;&#23450;&#25512;&#33616;&#26465;&#20214;<\/strong>&#65306;&#20026;&#27599;&#20010;&#25512;&#33616;&#21830;&#21697;&#35774;&#23450;&#19968;&#20123;&#25512;&#33616;&#26465;&#20214;&#65292;&#20363;&#22914;&#36141;&#20080;&#37329;&#39069;&#12289;&#36141;&#29289;&#36710;&#20013;&#30340;&#25968;&#37327;&#31561;&#12290;&#36825;&#20123;&#26465;&#20214;&#21487;&#20197;&#28608;&#21169;&#29992;&#25143;&#26356;&#31215;&#26497;&#22320;&#21442;&#19982;&#25512;&#33616;&#35745;&#21010;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#36319;&#36394;&#25512;&#33616;&#27963;&#21160;<\/strong>&#65306;&#36890;&#36807;&#20998;&#26512;&#25512;&#33616;&#27963;&#21160;&#30340;&#25968;&#25454;&#65292;&#24744;&#21487;&#20197;&#20102;&#35299;&#21738;&#20123;&#21830;&#21697;&#26368;&#21463;&#27426;&#36814;&#65292;&#20197;&#21450;&#21738;&#20123;&#21830;&#21697;&#38656;&#35201;&#26356;&#22810;&#30340;&#25512;&#24191;&#12290;&#26681;&#25454;&#25968;&#25454;&#35843;&#25972;&#25512;&#33616;&#35745;&#21010;&#12290;<\/p>\n<\/li>\n<li>\n<p><strong>&#20248;&#21270;&#25512;&#33616;&#20307;&#39564;<\/strong>&#65306;&#20026;&#20102;&#20445;&#25345;&#29992;&#25143;&#30340;&#20852;&#36259;&#21644;&#21442;&#19982;&#24230;&#65292;&#24744;&#21487;&#20197;&#32771;&#34385;&#25552;&#20379;&#22870;&#21169;&#26426;&#21046;&#65292;&#27604;&#22914;&#31215;&#20998;&#12289;&#20248;&#24800;&#21048;&#31561;&#65292;&#20197;&#36827;&#19968;&#27493;&#28608;&#21169;&#29992;&#25143;&#21442;&#19982;&#25512;&#33616;&#35745;&#21010;&#12290;<\/p>\n<\/li>\n<\/ol>\n<p>&#19979;&#38754;&#26159;&#19968;&#20010;&#31616;&#21333;&#30340;&#31034;&#20363;&#20195;&#30721;&#65292;&#23637;&#31034;&#20102;&#22914;&#20309;&#22312;WordPress&#20013;&#35774;&#32622;&#25512;&#33616;&#35745;&#21010;&#30340;&#22522;&#26412;&#27969;&#31243;&#65306;<\/p>\n<h3>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h3>\n<pre><code class=\"language-html\">&lt;!-- &#20551;&#35774;&#25105;&#20204;&#26377;&#19968;&#20010;&#21517;&#20026; \"Product\" &#30340;&#20135;&#21697;&#20998;&#31867; --&gt;\n&lt;div class=\"product\"&gt;\n    &lt;h2&gt;&lt;?php echo esc_html(get_the_title($post-&gt;ID)); ?&gt;&lt;\/h2&gt;\n    &lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;\n        &lt;div class=\"product-info\"&gt;\n            &lt;img src=\"&lt;?php the_post_thumbnail_url(); ?&gt;\" alt=\"\"&gt;\n            &lt;span&gt;&lt;?php the_excerpt(); ?&gt;&lt;\/span&gt;\n        &lt;\/div&gt;\n    &lt;?php endwhile; endif; wp_reset_query(); ?&gt;\n&lt;\/div&gt;\n\n&lt;!-- &#21019;&#24314;&#25512;&#33616;&#21830;&#21697; --&gt;\n&lt;?php\n$products = [\n    'product1' =&gt; [\n        'name' =&gt; 'Product 1',\n        'price' =&gt; 99,\n        'quantity' =&gt; 0,\n    ],\n    'product2' =&gt; [\n        'name' =&gt; 'Product 2',\n        'price' =&gt; 199,\n        'quantity' =&gt; 0,\n    ]\n];\n\n\/\/ &#35774;&#32622;&#25512;&#33616;&#26465;&#20214;\n$recommended_products = [];\nforeach ($products as $id =&gt; $data) {\n    if ($data['quantity'] &gt;= 10) {\n        $recommended_products[] = $id;\n    }\n}\n\n\/\/ &#28155;&#21152;&#25512;&#33616;&#21830;&#21697;&#21040;&#25512;&#33616;&#39029;&#38754;\necho \"&lt;div class='recommendation'&gt;\";\nif (!empty($recommended_products)) {\n    foreach ($recommended_products as $product_id) {\n        echo \"&lt;a href='\" . get_permalink($product_id) . \"' target='_blank'&gt;\";\n        echo \"&lt;img src='\" . get_the_post_thumbnail_url($product_id, 'thumbnail') . \"' alt='' style='width:100px;'&gt;\";\n        echo \"&lt;\/a&gt;\";\n    }\n}\necho \"&lt;\/div&gt;\";\n<\/code><\/pre>\n<p>&#22312;&#36825;&#20010;&#20363;&#23376;&#20013;&#65292;&#25105;&#20204;&#39318;&#20808;&#35774;&#32622;&#20102;&#20004;&#20010;&#25512;&#33616;&#21830;&#21697;&#65292;&#28982;&#21518;&#35745;&#31639;&#20102;&#21738;&#20010;&#21830;&#21697;&#30340;&#38144;&#37327;&#36229;&#36807;10&#20214;&#12290;&#26368;&#21518;&#65292;&#25105;&#20204;&#23558;&#36825;&#20004;&#20010;&#25512;&#33616;&#21830;&#21697;&#26174;&#31034;&#22312;&#25512;&#33616;&#39029;&#38754;&#19978;&#12290;<\/p>\n<p>&#35831;&#35760;&#20303;&#65292;&#36825;&#21482;&#26159;&#19968;&#20010;&#22522;&#26412;&#30340;&#31034;&#20363;&#65292;&#23454;&#38469;&#25805;&#20316;&#21487;&#33021;&#38656;&#35201;&#26681;&#25454;&#24744;&#30340;&#20855;&#20307;&#38656;&#27714;&#21644;&#29615;&#22659;&#36827;&#34892;&#35843;&#25972;&#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;&#21019;&#24314;&#25512;&#33616;&#35745;&#21010;&#26159;&#19968;&#31181;&#38750;&#24120;&#26377;&#29992;&#038;#3..<\/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-3299","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\/3299","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=3299"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3299\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3299"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}