{"id":1079,"date":"2009-05-19T10:46:57","date_gmt":"2009-05-19T02:46:57","guid":{"rendered":"https:\/\/www.wopus.org\/?p=1079"},"modified":"2009-05-19T10:46:57","modified_gmt":"2009-05-19T02:46:57","slug":"%e7%94%a8wordpress%e6%90%ad%e5%bb%ba%e7%b1%bbtwitter%e5%be%ae%e5%8d%9a%e5%ae%a2","status":"publish","type":"post","link":"https:\/\/wopus.org\/?p=1079","title":{"rendered":"\u7528WordPress\u642d\u5efa\u7c7bTwitter\u5fae\u535a\u5ba2"},"content":{"rendered":"<p>Twitter\u5f88\u706b\uff0c<a href=\"https:\/\/www.wopus.org\">WordPress<\/a>\u4e5f\u5f88\u706b\uff0c\u8fd9\u7bc7\u6587\u7ae0\u5c31\u6559\u5927\u5bb6\u4f7f\u7528WordPress\u642d\u5efa\u7c7bTwitter\u7684\u5fae\u535a\u5ba2\u3002<\/p>\n<p><strong>\u5177\u4f53\u505a\u6cd5\uff1a<\/strong><br \/>\n\u4e00\uff0c\u5728\u535a\u5ba2\u6839\u76ee\u5f55\u627e\u5230\uff1a<code>wp-config.php<\/code><br \/>\n\u52a0\u5165\u4e00\u4e0b\u4ee3\u7801\uff1a<br \/>\n<code>define('WP_POST_REVISIONS', false);\/\/\u4e3b\u8981\u4f5c\u7528\u662f\u8ba9ID\u8fde\u7eed<\/code><\/p>\n<p>\u4e8c\uff0c\u4e0a\u4f20\u5e76\u542f\u7528\u4e24\u4e2a\u63d2\u4ef6\uff1a<br \/>\n1\uff0c<a href=\"http:\/\/lesterchan.net\/wordpress\/readme\/wp-pagenavi.html\" target=\"_blank\">wp-pagenavi<\/a>:\u5206\u9875\u94fe\u63a5\u3002<br \/>\n2\uff0c<a href=\"http:\/\/goto8848.net\/projects\/super-switch\/\" target=\"_blank\">super-switch<\/a>\uff1a\u4e3b\u8981\u4f5c\u7528\u662f\u8ba9ID\u8fde\u7eed\u3002<\/p>\n<p>\u4e09\uff0c\u627e\u5230\uff1a<br \/>\n<code>wp-includes\/functions.php<\/code>\uff0c\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<br \/>\n<code>\/\/count 1 day post count1day()<br \/>\nfunction count1day()<br \/>\n{<br \/>\n\tglobal $wpdb;<br \/>\n\t$strsql = \"SELECT count( ID ) AS c FROM wp_posts WHERE post_date > SUBDATE(NOW(),INTERVAL 1 day)\" ;<br \/>\n    $xxooxx = $wpdb->get_var($strsql);<br \/>\n\treturn $xxooxx;<br \/>\n}<br \/>\n\/\/count 1 day post count1day()<br \/>\n\/\/count 1 week post count1week()<br \/>\nfunction count1week()<br \/>\n{<br \/>\n\tglobal $wpdb;<br \/>\n\t$strsql = \"SELECT count( ID ) AS c FROM wp_posts WHERE post_date > SUBDATE(NOW(),INTERVAL 1 week)\" ;<br \/>\n    $xxooxx = $wpdb->get_var($strsql);<br \/>\n\treturn $xxooxx;<br \/>\n}<br \/>\n\/\/count 1 week post count1week()<br \/>\n\/\/count post<br \/>\nfunction countsend()<br \/>\n{<br \/>\n\tglobal $wpdb;<br \/>\n\t$strsql = \"SELECT count( ID ) AS c FROM wp_posts\" ;<br \/>\n    $xxooxx = $wpdb->get_var($strsql);<br \/>\n\treturn $xxooxx;<br \/>\n}<br \/>\n\/\/count post<\/code><\/p>\n<p>\u56db\uff0c\u627e\u5230\uff1a<code>wp-includes\/general-template.php<\/code><br \/>\n\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<br \/>\n<code>\/\/\u5185\u9875\u6807\u9898\u8f93\u51fa\u5e26\u4e00\u90e8\u5206\u6b63\u6587<br \/>\n\/\/$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) );\/\/\u539f\u4ee3\u7801 \u66ff\u6362\u6210\u4ee5\u4e0b<br \/>\n\t\t$title = strip_tags( apply_filters( 'single_post_title', $post->post_title ) ).\":\".strip_tags( apply_filters( 'single_post_content', $post->post_content ) );<br \/>\nif(strlen($title) > 120)<br \/>\n$title = mb_substr($title,0,120,'UTF-8').\"...\";<br \/>\n<\/code><\/p>\n<p>\u64cd\u4f5c\u8bb0\u5f55\u4f5c\u8005\u4e5f\u6574\u7406\u4e86\u4e00\u4efd\uff0c<a href=\"http:\/\/tarr.cn\/demo\/wordpress-for-microblog.rar\">\u70b9\u51fb\u4e0b\u8f7d<\/a>\u3002<\/p>\n<p>\u6548\u679c\u53ef\u4ee5\u67e5\u770bDEMO:<a href=\"http:\/\/tarr.cn\/blog\/\" target=\"_blank\">http:\/\/tarr.cn\/blog\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twitter\u5f88\u706b\uff0cWordPress\u4e5f\u5f88\u706b\uff0c\u8fd9\u7bc7\u6587\u7ae0\u5c31\u6559\u5927\u5bb6\u4f7f\u7528WordPress\u642d\u5efa\u7c7bTwitter\u7684\u5fae\u535a\u5ba2\u3002 \u5177\u4f53\u505a\u6cd5\uff1a \u4e00\uff0c\u5728\u535a\u5ba2\u6839\u76ee\u5f55\u627e\u5230\uff1awp-config.php \u52a0\u5165\u4e00\u4e0b\u4ee3\u7801\uff1a define(&#8216;WP_POST_REVISIONS&#8217;, false);\/\/\u4e3b\u8981\u4f5c\u7528\u662f\u8ba9ID\u8fde\u7eed \u4e8c\uff0c\u4e0a\u4f20\u5e76\u542f\u7528\u4e24\u4e2a\u63d2\u4ef6\uff1a 1\uff0cwp-pagenavi:\u5206\u9875\u94fe\u63a5\u3002 2\uff0csuper-switch\uff1a\u4e3b\u8981\u4f5c\u7528\u662f\u8ba9ID\u8fde\u7eed\u3002 \u4e09\uff0c\u627e\u5230\uff1a wp-includes\/functions.php\uff0c\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a \/\/count 1 day post count1day() function count1day() { global $wpdb; $strsql = &#8220;SELECT count( ID ) AS c FROM wp_posts WHERE post_date > SUBDATE(NOW(),INTERVAL 1 day)&#8221; ; $xxooxx = $wpdb->get_var($strsql); return $xxooxx; } \/\/count 1 day post count1day() \/\/count 1 week post count1week() function [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[272,313,781],"class_list":["post-1079","post","type-post","status-publish","format-standard","hentry","category-tech","tag-twitter","tag-wordpress","tag-781"],"_links":{"self":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1079"}],"version-history":[{"count":0,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1079\/revisions"}],"wp:attachment":[{"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}