{"id":2817,"date":"2025-06-11T07:24:50","date_gmt":"2025-06-10T23:24:50","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/2817.html"},"modified":"2025-06-11T07:24:50","modified_gmt":"2025-06-10T23:24:50","slug":"%e5%a6%82%e4%bd%95%e5%b0%86%e4%bd%a0%e7%9a%84wordpress%e5%8d%9a%e5%ae%a2%e6%b7%bb%e5%8a%a0%e5%88%b0apple-news","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/2817.html","title":{"rendered":"\u5982\u4f55\u5c06\u4f60\u7684WordPress\u535a\u5ba2\u6dfb\u52a0\u5230Apple News"},"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;&#22312;WordPress&#21338;&#23458;&#19978;&#28155;&#21152;&#21040;Apple News&#65292;&#20320;&#38656;&#35201;&#25353;&#29031;&#20197;&#19979;&#27493;&#39588;&#25805;&#20316;&#65306;<\/p>\n<ol>\n<li><strong>&#30331;&#24405;&#21040;&#24744;&#30340;WordPress&#31649;&#29702;&#21518;&#21488;<\/strong>&#12290;<\/li>\n<li><strong>&#23548;&#33322;&#21040;&ldquo;&#35774;&#32622;&rdquo; -&gt; &ldquo;&#23186;&#20307;&#24211;&rdquo;<\/strong>&#12290;<\/li>\n<li>&#22312;&ldquo;&#23186;&#20307;&#24211;&rdquo;&#39029;&#38754;&#30340;&#24213;&#37096;&#65292;&#28857;&#20987;&ldquo;&#19978;&#20256;&rdquo;&#25353;&#38062;&#12290;<\/li>\n<li>&#20174;&#24744;&#35745;&#31639;&#26426;&#19978;&#30340;&#25991;&#20214;&#22841;&#25110;&#20113;&#23384;&#20648;&#26381;&#21153;&#65288;&#22914;Dropbox&#65289;&#20013;&#36873;&#25321;&#19968;&#20010;&#21253;&#21547;&#26032;&#38395;&#25991;&#31456;&#22270;&#29255;&#30340;&#25991;&#20214;&#65292;&#28982;&#21518;&#28857;&#20987;&ldquo;&#19978;&#20256;&rdquo;&#12290;<\/li>\n<li>&#22312;&#26032;&#20986;&#29616;&#30340;&#39029;&#38754;&#20013;&#65292;&#25214;&#21040;&#24182;&#28857;&#20987;&ldquo;&#28155;&#21152;&#21040;Apple News&rdquo;&#30340;&#38142;&#25509;&#12290;<\/li>\n<\/ol>\n<p>&#29616;&#22312;&#65292;&#24744;&#30340;WordPress&#25991;&#31456;&#24050;&#32463;&#34987;&#25104;&#21151;&#28155;&#21152;&#21040;&#20102;Apple News&#12290;&#24744;&#21487;&#20197;&#22312;Apple News&#24212;&#29992;&#20013;&#26597;&#30475;&#36825;&#20123;&#25991;&#31456;&#20102;&#12290;<\/p>\n<h3>&#31034;&#20363;&#20195;&#30721;<\/h3>\n<p>&#20551;&#35774;&#24744;&#24050;&#32463;&#26377;&#19968;&#20010;&#21517;&#20026;<code>example-post.jpg<\/code>&#30340;&#22270;&#29255;&#25991;&#20214;&#65292;&#24744;&#21487;&#20197;&#23558;&#20854;&#19978;&#20256;&#21040;WordPress&#30340;&#23186;&#20307;&#24211;&#20013;&#65292;&#28982;&#21518;&#36890;&#36807;&#20197;&#19979;PHP&#20195;&#30721;&#23558;&#22270;&#29255;&#25554;&#20837;&#21040;HTML&#25991;&#26723;&#20013;&#65306;<\/p>\n<pre><code class=\"language-php\">&lt;img src=\"&lt;?php echo get_template_directory_uri(); ?&gt;\/example-post.jpg\" alt=\"Example Post\"&gt;<\/code><\/pre>\n<p>&#36825;&#20010;&#20195;&#30721;&#29255;&#27573;&#20250;&#26174;&#31034;WordPress&#21338;&#23458;&#20013;&#30340;&#19968;&#20010;&#22270;&#29255;&#12290;&#35831;&#30830;&#20445;&#23558;<code>&lt;?php echo get_template_directory_uri(); ?&gt;<\/code>&#26367;&#25442;&#20026;&#24744;&#33258;&#24049;&#30340;&#20027;&#39064;&#30446;&#24405;URI&#65292;&#20197;&#20415;&#27491;&#30830;&#24341;&#29992;&#22270;&#29255;&#12290;<\/p>\n<h3>&#20351;&#29992;&#27493;&#39588;&#21450;&#25928;&#26524;<\/h3>\n<ul>\n<li><strong>&#27493;&#39588;1<\/strong>: &#30331;&#24405;&#21040;WordPress&#31649;&#29702;&#21518;&#21488;&#12290;<\/li>\n<li><strong>&#27493;&#39588;2<\/strong>: &#23548;&#33322;&#21040;&ldquo;&#35774;&#32622;&rdquo; -&gt; &ldquo;&#23186;&#20307;&#24211;&rdquo;&#12290;<\/li>\n<li><strong>&#27493;&#39588;3<\/strong>: &#28857;&#20987;&ldquo;&#19978;&#20256;&rdquo;&#25353;&#38062;&#12290;<\/li>\n<li><strong>&#27493;&#39588;4<\/strong>: &#23558;&#22270;&#29255;&#25991;&#20214;&#25302;&#25918;&#21040;&#25991;&#20214;&#19978;&#20256;&#31383;&#21475;&#12290;<\/li>\n<li><strong>&#27493;&#39588;5<\/strong>: &#25214;&#21040;&#24182;&#28857;&#20987;&ldquo;&#28155;&#21152;&#21040;Apple News&rdquo;&#38142;&#25509;&#12290;<\/li>\n<li><strong>&#27493;&#39588;6<\/strong>: &#27983;&#35272;Apple News&#24212;&#29992;&#65292;&#24744;&#24212;&#35813;&#33021;&#30475;&#21040;&#21018;&#25165;&#19978;&#20256;&#30340;&#25991;&#31456;&#12290;<\/li>\n<\/ul>\n<p>&#36825;&#26679;&#65292;&#24744;&#30340;WordPress&#21338;&#23458;&#25991;&#31456;&#23601;&#24050;&#32463;&#25104;&#21151;&#22320;&#34987;&#28155;&#21152;&#21040;&#20102;Apple News&#24212;&#29992;&#31243;&#24207;&#20013;&#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&#19978;&#21019;&#24314;&#19968;&#20010;&#26032;&#38395;&#35746;&#38405;&#26381;&#21153;&#21487;&#20197;&#35753;&#20320;&#30340;&#29992;&#25143;&#26356;&#23481;&#26131;&#22320;&#33719;&#21462;&#26368;&#26032;&#30340;&#25991;&#31456;&#21644;&#26356;&#26032;&#12290;&#20197;&#19979;&#26159;&#22914;&#20309;&#20351;&#29992;WordPress&#25554;&#20214;&#23558;&#24744;&#30340;WordPress&#21338;&#23458;&#28155;&#21152;&#21040;Apple News&#30340;&#26041;&#27861;&#65306;<\/p>\n<h3>&#27493;&#39588;1: &#23433;&#35013;WordPress&#25554;&#20214;<\/h3>\n<p>&#39318;&#20808;&#65292;&#20320;&#38656;&#35201;&#23433;&#35013;&#19968;&#20010;&#20801;&#35768;&#20320;&#20174;WordPress&#21457;&#24067;&#21040;Apple News&#30340;&#25554;&#20214;&#12290;&#26377;&#35768;&#22810;&#36825;&#26679;&#30340;&#25554;&#20214;&#21487;&#20379;&#36873;&#25321;&#65292;&#21253;&#25324;&ldquo;WP Apple News&rdquo;&#12289;&ldquo;WordPress News Syndication&rdquo;&#31561;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;:<\/h4>\n<pre><code class=\"language-php\">add_action( 'wp_insert_post', function($post) {\n    $post-&gt;post_name = 'apple_news_post';\n    $post-&gt;post_content = '&#36825;&#26159;&#19968;&#20010;&#33529;&#26524;&#26032;&#38395;&#30340;&#20869;&#23481;';\n    $post-&gt;post_type = 'news';\n    wp_update_post($post);\n});<\/code><\/pre>\n<p>&#36825;&#20010;&#20363;&#23376;&#23450;&#20041;&#20102;&#19968;&#20010;&#33258;&#23450;&#20041;&#20989;&#25968;&#65292;&#22312;WordPress&#30340;&#25554;&#20837;&#25991;&#31456;&#65288;<code>wp_insert_post<\/code>&#65289;&#36807;&#31243;&#20013;&#35843;&#29992;&#23427;&#12290;&#36825;&#23558;&#22312;&#26032;&#30340;&#25991;&#31456;&#26631;&#39064;&#20026;&#8221;apple_news_post&#8221;&#12289;&#20869;&#23481;&#20026;&#8221;&#36825;&#26159;&#19968;&#20010;&#33529;&#26524;&#26032;&#38395;&#30340;&#20869;&#23481;&#8221;&#12289;&#31867;&#22411;&#20026;&#8221;news&#8221;&#30340;&#25991;&#31456;&#20013;&#25554;&#20837;&#12290;<\/p>\n<h3>&#27493;&#39588;2: &#37197;&#32622;&#25554;&#20214;<\/h3>\n<p>&#30830;&#20445;&#20320;&#22312;WordPress&#30340;&#35774;&#32622;&#37324;&#21551;&#29992;&#20102;&#25554;&#20214;&#12290;&#28982;&#21518;&#37197;&#32622;&#25554;&#20214;&#20197;&#25509;&#21463;&#26469;&#33258;Apple&#30340;&#26032;&#28040;&#24687;&#26469;&#28304;&#38142;&#25509;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;:<\/h4>\n<pre><code class=\"language-php\">function add_news_sources() {\n  if (isset($_GET['sources'])) {\n      $news_sources = array(\n        array('name' =&gt; 'Apple News', 'url' =&gt; 'https:\/\/example.com\/news'),\n        \/\/ &#28155;&#21152;&#26356;&#22810;&#28304;...\n      );\n      $options = array(\n        'allowed_sources' =&gt; $news_sources,\n      );\n      update_option('news_sources_options', $options);\n  }\n}\nadd_action('admin_init', 'add_news_sources');<\/code><\/pre>\n<p>&#36825;&#20010;&#20363;&#23376;&#23450;&#20041;&#20102;&#19968;&#20010;&#33258;&#23450;&#20041;&#20989;&#25968;&#65292;&#29992;&#20110;&#26816;&#26597;&#26159;&#21542;&#35774;&#32622;&#20102;&#26032;&#30340;&#28040;&#24687;&#26469;&#28304;&#38142;&#25509;&#12290;&#22914;&#26524;&#23384;&#22312;&#65292;&#23427;&#20250;&#21152;&#36733;&#24182;&#24212;&#29992;&#36825;&#20123;&#20449;&#24687;&#12290;<\/p>\n<h3>&#27493;&#39588;3: &#23454;&#29616;&#19982;Apple News&#38598;&#25104;<\/h3>\n<p>&#22312;WordPress&#30340;&#21518;&#21488;&#31649;&#29702;&#30028;&#38754;&#20013;&#65292;&#25214;&#21040;&ldquo;News&rdquo;&#26631;&#31614;&#39029;&#19979;&#30340;&ldquo;Add New Source&rdquo;&#36873;&#39033;&#21345;&#12290;&#22312;&#36825;&#37324;&#65292;&#20320;&#21487;&#20197;&#36755;&#20837;&#26469;&#33258;Apple&#30340;&#29305;&#23450;&#26032;&#38395;&#28304;&#30340;&#38142;&#25509;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;:<\/h4>\n<pre><code class=\"language-html\">&lt;a href=\"https:\/\/www.apple.com\/news\/\"&gt;Apple News&lt;\/a&gt;<\/code><\/pre>\n<h3>&#27493;&#39588;4: &#27979;&#35797;<\/h3>\n<p>&#23436;&#25104;&#21518;&#65292;&#28857;&#20987;&ldquo;&#27979;&#35797;&rdquo;&#25353;&#38062;&#26469;&#39564;&#35777;&#25554;&#20214;&#26159;&#21542;&#27491;&#30830;&#24037;&#20316;&#12290;&#20320;&#21487;&#33021;&#20250;&#25910;&#21040;&#19968;&#26465;&#36890;&#30693;&#65292;&#21578;&#30693;&#20320;&#24050;&#25104;&#21151;&#23558;&#20320;&#30340;WordPress&#21338;&#23458;&#28155;&#21152;&#21040;Apple News&#12290;<\/p>\n<p>&#20197;&#19978;&#27493;&#39588;&#24212;&#35813;&#24110;&#21161;&#20320;&#25104;&#21151;&#23558;&#20320;&#30340;WordPress&#21338;&#23458;&#28155;&#21152;&#21040;Apple News&#12290;&#26681;&#25454;&#20855;&#20307;&#38656;&#27714;&#65292;&#21487;&#33021;&#38656;&#35201;&#35843;&#25972;&#19978;&#36848;&#20195;&#30721;&#25110;&#22686;&#21152;&#26356;&#22810;&#30340;&#37197;&#32622;&#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;&#22312;WordPress&#21338;&#23458;&#19978;&#28155;&#21152;&#21040;Apple News&#65292;&#20320;&#38656;&#35201;&#25353;&#29031;&#038;..<\/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":[59],"tuisongtax":[],"class_list":["post-2817","post","type-post","status-publish","format-standard","hentry","category-wpdt","tag-pzjc"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2817","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=2817"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/2817\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=2817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=2817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=2817"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=2817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}