{"id":3445,"date":"2025-06-11T23:05:40","date_gmt":"2025-06-11T15:05:40","guid":{"rendered":"https:\/\/www.zhaozhao123.cn\/wpcms\/wpdt\/3445.html"},"modified":"2025-06-11T23:05:40","modified_gmt":"2025-06-11T15:05:40","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-wordpress-%e4%b8%ad%e6%98%be%e7%a4%ba-facebook-%e9%a1%b5%e9%9d%a2%e8%af%84%e8%ae%ba","status":"publish","type":"post","link":"https:\/\/www.zhaozhao123.cn\/wpcms\/post\/3445.html","title":{"rendered":"\u5982\u4f55\u5728 WordPress \u4e2d\u663e\u793a Facebook \u9875\u9762\u8bc4\u8bba"},"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;&#23454;&#29616;WordPress&#20013;&#30340;Facebook&#39029;&#38754;&#35780;&#35770;&#65292;&#20320;&#38656;&#35201;&#20808;&#30830;&#20445;&#24050;&#32463;&#23433;&#35013;&#24182;&#28608;&#27963;&#20102;WordPress&#30340;&#35780;&#35770;&#25554;&#20214;&#65288;&#22914;CommentPress&#25110;WP Comments&#31561;&#65289;&#65292;&#20197;&#21450;Facebook&#23448;&#26041;&#30340;&#35780;&#35770;&#25554;&#20214;&#65288;&#22914;FB Comment Box&#65289;&#12290;&#20197;&#19979;&#26159;&#19968;&#27493;&#39588;&#21644;&#30456;&#24212;&#30340;&#20195;&#30721;&#31034;&#20363;&#12290;<\/p>\n<h3>&#27493;&#39588;1&#65306;&#23433;&#35013;&#19982;&#28608;&#27963;&#35780;&#35770;&#25554;&#20214;<\/h3>\n<ol>\n<li>&#30331;&#24405;&#21040;&#24744;&#30340;WordPress&#21518;&#21488;&#12290;<\/li>\n<li>&#36827;&#20837;&ldquo;&#25554;&#20214;&rdquo;&#33756;&#21333;&#12290;<\/li>\n<li>&#25628;&#32034;&#24182;&#36873;&#25321;&#24744;&#24819;&#35201;&#23433;&#35013;&#30340;&#35780;&#35770;&#25554;&#20214;&#65292;&#20363;&#22914;&ldquo;CommentPress&rdquo;&#25110;&ldquo;WP Comments&rdquo;&#12290;<\/li>\n<li>&#28857;&#20987;&ldquo;&#23433;&#35013;&rdquo;&#65292;&#28982;&#21518;&#28857;&#20987;&ldquo;&#28608;&#27963;&rdquo;&#12290;<\/li>\n<\/ol>\n<h3>&#27493;&#39588;2&#65306;&#23433;&#35013;&#19982;&#28608;&#27963;Facebook&#35780;&#35770;&#25554;&#20214;<\/h3>\n<ol>\n<li>&#21516;&#26679;&#36827;&#20837;&ldquo;&#25554;&#20214;&rdquo;&#33756;&#21333;&#12290;<\/li>\n<li>&#36873;&#25321;&ldquo;&#25628;&#32034;&#25554;&#20214;&rdquo;&#12290;<\/li>\n<li>&#22312;&#25628;&#32034;&#26694;&#20013;&#36755;&#20837;&ldquo;Facebook&rdquo;&#12290;<\/li>\n<li>&#25214;&#21040;&#21517;&#20026;&ldquo;Facebook Comments&rdquo;&#30340;&#25554;&#20214;&#65292;&#28857;&#20987;&ldquo;&#19979;&#36733;&rdquo;&#25353;&#38062;&#12290;<\/li>\n<li>&#23433;&#35013;&#24182;&#28608;&#27963;&#36825;&#20010;&#25554;&#20214;&#12290;<\/li>\n<\/ol>\n<h3>&#27493;&#39588;3&#65306;&#28155;&#21152;Facebook&#35780;&#35770;&#21151;&#33021;<\/h3>\n<p>&#20551;&#35774;&#25105;&#20204;&#26377;&#19968;&#20010;&#21517;&#20026;&ldquo;&#25105;&#30340;&#21338;&#23458;&rdquo;&#30340;&#32593;&#31449;&#65292;&#24182;&#19988;&#20320;&#24819;&#22312;&#27599;&#20010;&#24086;&#23376;&#19979;&#38754;&#26174;&#31034;Facebook&#30340;&#35780;&#35770;&#37096;&#20998;&#12290;&#20320;&#21487;&#20197;&#36890;&#36807;&#32534;&#36753;&#27169;&#26495;&#25991;&#20214;&#26469;&#23454;&#29616;&#36825;&#19968;&#28857;&#12290;<\/p>\n<h4>&#31034;&#20363;&#20195;&#30721;&#65306;<\/h4>\n<pre><code class=\"language-php\">&lt;?php if ( comments_open() &amp;&amp; get_option( 'thread_comments' ) ) : ?&gt;\n    &lt;div id=\"comments\"&gt;\n        &lt;?php comment_form(); ?&gt;\n    &lt;\/div&gt;\n&lt;?php endif; ?&gt;\n\n&lt;div class=\"fb-comments\" data-href=\"&lt;?php the_permalink(); ?&gt;\" data-numposts=\"5\"&gt;&lt;\/div&gt;\n\n&lt;?php wp_list_comments(); \/\/ &#33258;&#21160;&#21152;&#36733;wp_list_comments&#20989;&#25968; ?&gt;<\/code><\/pre>\n<p>&#36825;&#27573;&#20195;&#30721;&#39318;&#20808;&#26816;&#26597;&#26159;&#21542;&#20801;&#35768;&#35780;&#35770;&#65292;&#24182;&#19988;&#26159;&#21542;&#21551;&#29992;&#20102;&#35780;&#35770;&#34920;&#21333;&#30340;&#21151;&#33021;&#12290;&#22914;&#26524;&#28385;&#36275;&#26465;&#20214;&#65292;&#21017;&#26174;&#31034;&#40664;&#35748;&#30340;&#35780;&#35770;&#34920;&#21333;&#65307;&#22914;&#26524;&#19981;&#38656;&#35201;&#33258;&#21160;&#21152;&#36733;<code>wp_list_comments()<\/code>&#20989;&#25968;&#65292;&#21487;&#20197;&#23558;&#20854;&#27880;&#37322;&#25481;&#20197;&#36991;&#20813;&#37325;&#22797;&#21152;&#36733;&#12290;<\/p>\n<ul>\n<li><code>data-href=\"&lt;?php the_permalink(); ?&gt;\"<\/code>: &#35774;&#32622;&#35780;&#35770;&#38142;&#25509;&#30340;&#30446;&#26631;URL&#20026;&#24403;&#21069;&#25991;&#31456;&#30340;permalink&#12290;<\/li>\n<li><code>data-numposts=\"5\"<\/code>: &#35774;&#32622;&#26368;&#22810;&#26174;&#31034;5&#26465;&#35780;&#35770;&#12290;<\/li>\n<\/ul>\n<h3>&#25928;&#26524;&#23637;&#31034;<\/h3>\n<p>&#24403;&#20320;&#21457;&#24067;&#19968;&#31687;&#25991;&#31456;&#26102;&#65292;&#35780;&#35770;&#37096;&#20998;&#20250;&#33258;&#21160;&#26174;&#31034;&#22312;&#25991;&#31456;&#24213;&#37096;&#65292;&#29992;&#25143;&#21487;&#20197;&#36890;&#36807;Facebook&#30331;&#24405;&#25110;&#28857;&#20987;&#30331;&#24405;&#21518;&#21457;&#34920;&#35780;&#35770;&#12290;<\/p>\n<h3>&#27880;&#24847;&#20107;&#39033;<\/h3>\n<ul>\n<li>&#30830;&#20445;&#25152;&#26377;&#24517;&#35201;&#30340;&#25554;&#20214;&#37117;&#24050;&#27491;&#30830;&#23433;&#35013;&#21644;&#28608;&#27963;&#12290;<\/li>\n<li>&#26681;&#25454;&#38656;&#35201;&#35843;&#25972;&#20195;&#30721;&#20013;&#30340;&#21442;&#25968;&#65292;&#27604;&#22914;<code>data-numposts<\/code>&#29992;&#20110;&#25511;&#21046;&#26174;&#31034;&#30340;&#35780;&#35770;&#25968;&#37327;&#12290;<\/li>\n<li>&#22914;&#26524;&#36935;&#21040;&#20219;&#20309;&#38382;&#39064;&#65292;&#35831;&#26816;&#26597;&#25554;&#20214;&#30340;&#25991;&#26723;&#25110;&#32773;&#23547;&#27714;&#31038;&#21306;&#30340;&#24110;&#21161;&#12290;<\/li>\n<\/ul>\n<p>&#20197;&#19978;&#23601;&#26159;&#22914;&#20309;&#22312;WordPress&#20013;&#38598;&#25104;Facebook&#39029;&#38754;&#35780;&#35770;&#30340;&#22522;&#26412;&#27493;&#39588;&#21644;&#30456;&#20851;&#20195;&#30721;&#12290;&#24076;&#26395;&#36825;&#33021;&#24110;&#21161;&#24744;&#39034;&#21033;&#23454;&#29616;&#30446;&#26631;&#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;&#65292;&#20320;&#21487;&#20197;&#20351;&#29992;Facebook&#30340;&#25554;&#20214;&#26469;&#26174;&#31034;Facebook&#39029;&#38754;&#19978;&#30340;&#35780;&#35770;&#12290;&#20197;&#19979;&#26159;&#22914;&#20309;&#23454;&#29616;&#36825;&#20010;&#21151;&#33021;&#30340;&#19968;&#33324;&#27493;&#39588;&#65306;<\/p>\n<ol>\n<li>\n<p>&#23433;&#35013;&#21644;&#28608;&#27963;Facebook&#30340;&#25554;&#20214;&#65306;&#39318;&#20808;&#65292;&#20320;&#38656;&#35201;&#23433;&#35013;&#24182;&#28608;&#27963;&#19968;&#20010;Facebook&#25554;&#20214;&#65292;&#22914;&#8221;Facebook Comments for WordPress&#8221;&#12290;&#20320;&#21487;&#20197;&#36890;&#36807;WordPress&#21518;&#21488;&#30340;&ldquo;&#25554;&#20214;&rdquo;&#33756;&#21333;&#26469;&#26597;&#25214;&#21644;&#23433;&#35013;&#12290;<\/p>\n<\/li>\n<li>\n<p>&#35774;&#32622;Facebook&#30331;&#24405;&#65306;&#22312;&#35774;&#32622;Facebook&#25554;&#20214;&#26102;&#65292;&#20320;&#38656;&#35201;&#35774;&#32622;&#19968;&#20123;&#22522;&#26412;&#30340;&#20449;&#24687;&#65292;&#22914;&#32593;&#31449;URL&#12289;&#24212;&#29992;ID&#21644;&#24212;&#29992;&#23494;&#38053;&#31561;&#12290;&#36825;&#20123;&#20449;&#24687;&#21487;&#20197;&#22312;Facebook&#24320;&#21457;&#32773;&#25511;&#21046;&#21488;&#25214;&#21040;&#12290;<\/p>\n<\/li>\n<li>\n<p>&#28155;&#21152;&#35780;&#35770;&#65306;&#19968;&#26086;&#20320;&#35774;&#32622;&#20102;Facebook&#30331;&#24405;&#65292;&#23601;&#21487;&#20197;&#24320;&#22987;&#28155;&#21152;&#35780;&#35770;&#20102;&#12290;&#20320;&#21487;&#20197;&#20351;&#29992;&#20869;&#32622;&#30340;&#35780;&#35770;&#25353;&#38062;&#25110;&#33258;&#23450;&#20041;&#30340;HTML&#26631;&#31614;&#12290;<\/p>\n<\/li>\n<\/ol>\n<p>&#20197;&#19979;&#26159;&#21019;&#24314;&#19968;&#20010;&#31616;&#21333;&#30340;WordPress&#24086;&#23376;&#20197;&#26174;&#31034;Facebook&#35780;&#35770;&#30340;&#31034;&#20363;&#20195;&#30721;&#65306;<\/p>\n<pre><code class=\"language-php\">&lt;?php\n\/*\nPlugin Name: Facebook Comments\nDescription: Display comments from a Facebook page on your website.\nVersion: 1.0\nAuthor: Your Name\n*\/\n\nadd_shortcode('fbcomments', 'fb_comments');\n\nfunction fb_comments() {\n    $post_id = get_query_var( 'post_id' );\n    if ( ! $post_id ) {\n        return;\n    }\n\n    \/\/ Get the comment count and start with an empty array\n    $comment_count = wp_count_comments($post_id);\n    $comments = [];\n\n    \/\/ Loop through all comments, add them to the comments array\n    foreach(get_comments(array(\n        'post_ID' =&gt; $post_id,\n        'status' =&gt; 'approve'\n    )) as $comment) {\n        $comments[] = [\n            'name' =&gt; $comment-&gt;comment_author,\n            'email' =&gt; $comment-&gt;comment_author_email,\n            'url' =&gt; $comment-&gt;comment_link,\n            'content' =&gt; $comment-&gt;comment_content,\n        ];\n    }\n\n    \/\/ Render the shortcode with the comments\n    return '&lt;div class=\"fb-comments\" data-href=\"' . esc_url(get_permalink()) . '\" data-width=\"600\"&gt;&lt;\/div&gt;';\n}<\/code><\/pre>\n<p>&#36825;&#20010;&#33050;&#26412;&#23558;&#26174;&#31034;&#19968;&#20010;&#21253;&#21547;Facebook&#35780;&#35770;&#30340;&#35780;&#35770;&#26694;&#65292;&#20854;&#20869;&#23481;&#26469;&#33258;&#25351;&#23450;&#30340;&#24086;&#23376;&#12290;&#35831;&#30830;&#20445;&#23558;&#19978;&#36848;&#20195;&#30721;&#20013;&#30340;<code>get_comment_count()<\/code>&#20989;&#25968;&#26367;&#25442;&#20026;&#23454;&#38469;&#30340;Facebook&#35780;&#35770;&#35745;&#25968;&#20989;&#25968;&#65292;&#20197;&#21450;&#23558;<code>$post_id<\/code>&#21464;&#37327;&#26367;&#25442;&#20026;&#35201;&#33719;&#21462;&#35780;&#35770;&#30340;&#24086;&#23376;ID&#12290;<\/p>\n<p>&#35831;&#27880;&#24847;&#65292;&#36825;&#21482;&#26159;&#19968;&#20010;&#22522;&#26412;&#30340;&#20363;&#23376;&#65292;&#23454;&#38469;&#30340;Facebook&#25554;&#20214;&#21487;&#33021;&#38656;&#35201;&#26356;&#22810;&#30340;&#23450;&#21046;&#21644;&#37197;&#32622;&#25165;&#33021;&#28385;&#36275;&#29305;&#23450;&#30340;&#38656;&#27714;&#12290;&#20363;&#22914;&#65292;&#20320;&#21487;&#33021;&#38656;&#35201;&#22788;&#29702;&#29992;&#25143;&#26435;&#38480;&#38382;&#39064;&#65292;&#25110;&#32773;&#35843;&#25972;&#35780;&#35770;&#26679;&#24335;&#20197;&#36866;&#24212;&#20320;&#30340;&#31449;&#28857;&#35774;&#35745;&#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;&#23454;&#29616;WordPress&#20013;&#30340;Facebook&#39029;&#38754;&#35780;&#35770;&#65292;&#20320;&#38656;&#35201;&#20808;&#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-3445","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\/3445","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=3445"}],"version-history":[{"count":0,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/posts\/3445\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/media?parent=3445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/categories?post=3445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tags?post=3445"},{"taxonomy":"tuisongtax","embeddable":true,"href":"https:\/\/www.zhaozhao123.cn\/wpcms\/wp-json\/wp\/v2\/tuisongtax?post=3445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}