{"id":1572,"date":"2009-10-12T00:26:23","date_gmt":"2009-10-11T16:26:23","guid":{"rendered":"https:\/\/www.wopus.org\/?p=1572"},"modified":"2009-10-12T00:26:23","modified_gmt":"2009-10-11T16:26:23","slug":"wordpress%e4%b8%bb%e9%a2%98%e8%ae%be%e8%ae%a1%e5%b8%b8%e7%94%a8%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/wopus.org\/?p=1572","title":{"rendered":"WordPress\u4e3b\u9898\u8bbe\u8ba1\u5e38\u7528\u4ee3\u7801"},"content":{"rendered":"<p>\u5e0c\u671b\u5bf9\u90a3\u4e9b\u5728\u5b66\u4e60<a href=\"http:\/\/themes.wopus.org\" target=\"_blank\">WordPress\u4e3b\u9898<\/a>\u5236\u4f5c\u7684\u670b\u53cb\u6709\u5e2e\u52a9\u3002<\/p>\n<p><strong>\u663e\u793a\u6700\u8fd1\u6587\u7ae0\uff1a<\/strong><br \/>\n<code>< ?php wp_get_archives('type=postbypost&#038;limit=5'); ?><\/code><\/p>\n<p>\u6216\u8005\uff1a<br \/>\n<code>< ?php  $recentposts = get_posts('numberposts=12&#038;category=4'); \nforeach ($recentposts as $post) :      setup_postdata($post);  ?> <\/p>\n<li><a href=\"<?php the_permalink() ?>\">< ?php the_title(); ?><\/a><\/li>\n<p>  < ?php endforeach; ?><\/code><\/p>\n<p><strong>\u663e\u793a\u5206\u7c7b\uff1a<\/strong><br \/>\n<code><\/p>\n<h2>Categories<\/h2>\n<ul>\n< ?php wp_list_cats('sort_column=name'); ?>\n<\/ul>\n<p><\/code><\/p>\n<p><strong>\u663e\u793a\u5b58\u6863\uff1a<\/strong><br \/>\n<code><\/p>\n<h2>Archives<\/h2>\n<ul>\n< ?php wp_get_archives('type=monthly'); ?>\n<\/ul>\n<p><\/code><\/p>\n<p><strong>\u663e\u793a\u6807\u7b7e\u4e91\uff1a<\/strong><br \/>\n<code>< ?php wp_tag_cloud('smallest=8&#038;largest=36&#038;'); ?><\/code><\/p>\n<p><strong>\u663e\u793a\u53cb\u60c5\u94fe\u63a5\uff1a<\/strong><br \/>\n<code><\/p>\n<ul>  < ?php wp_list_bookmarks('title_li=&#038;categorize=0'); ?>  <\/ul>\n<p><\/code><\/p>\n<p><strong>\u663e\u793a\u6807\u7b7e\uff1a<\/strong><br \/>\n<code>< ?php the_tags(); ?><\/code><\/p>\n<p><strong>\u663e\u793a\u9875\u9762\u5bfc\u822a\u83dc\u5355:<\/strong><br \/>\n<code><\/p>\n<h2>Pages<\/h2>\n<ul>\n< ?php wp_list_pages('title_li='); ?>\n<\/ul>\n<p><\/code><\/p>\n<p><strong>\u663e\u793a\u6700\u65b0\u8bc4\u8bba:<\/strong><br \/>\n<code>< ?php \nglobal $wpdb; \n$sql = \"SELECT DISTINCT ID, post_title, post_password, comment_ID, \ncomment_post_ID, comment_author, comment_date_gmt, comment_approved, \ncomment_type,comment_author_url, \nSUBSTRING(comment_content,1,30) AS com_excerpt \nFROM $wpdb->comments<br \/>\nLEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =<br \/>\n$wpdb->posts.ID)<br \/>\nWHERE comment_approved = '1' AND comment_type = '' AND<br \/>\npost_password = ''<br \/>\nORDER BY comment_date_gmt DESC<br \/>\nLIMIT 10\";<br \/>\n$comments = $wpdb->get_results($sql);<br \/>\n$output = $pre_HTML;<br \/>\n$output .= \"n<\/p>\n<ul>\";<br \/>\nforeach ($comments as $comment) {<br \/>\n$output .= \"n<\/p>\n<li>\".strip_tags($comment->comment_author)<br \/>\n.\":\" . \"<a href=\"\" . get_permalink($comment->ID) .<br \/>\n\"#comment-\" . $comment->comment_ID . \"\" title=\"on \" .<br \/>\n$comment->post_title . \"\">\" . strip_tags($comment->com_excerpt)<br \/>\n.\"<\/a><\/li>\n<p>\";<br \/>\n}<br \/>\n$output .= \"n<\/ul>\n<p>\";<br \/>\n$output .= $post_HTML;<br \/>\necho $output;?><\/code><\/p>\n<p><strong>\u663e\u793a\u7ba1\u7406\u9762\u677f:<\/strong><br \/>\n<code><\/p>\n<ul>\n< ?php wp_register(); ?> <\/p>\n<li>< ?php wp_loginout(); ?><\/li>\n<li><a href=\"http:\/\/www.wordpress.org\/\">WordPress<\/a><\/li>\n<p>< ?php wp_meta(); ?> <\/p>\n<li><a href=\"http:\/\/validator.w3.org\/check?uri=referer\">XHTML<\/a><\/li>\n<\/ul>\n<p><\/code><\/p>\n<p><strong>\u663e\u793a\u70ed\u95e8\u8bc4\u8bba:<\/strong><br \/>\n<code>< ?php $result = $wpdb->get_results(\"SELECT<br \/>\ncomment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count<br \/>\nDESC LIMIT 0 , 10\");<br \/>\nforeach ($result as $topten) {<br \/>\n$postid = $topten->ID;<br \/>\n$title = $topten->post_title;<br \/>\n$commentcount = $topten->comment_count;<br \/>\nif ($commentcount != 0) { ?> <\/p>\n<li><a href=\"<?php echo get_permalink($postid); ?>\"<br \/>\ntitle=\"< ?php echo $title ?>\">< ?php echo $title \n?><\/a><\/li>\n<p>< ?php } } ?><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e0c\u671b\u5bf9\u90a3\u4e9b\u5728\u5b66\u4e60WordPress\u4e3b\u9898\u5236\u4f5c\u7684\u670b\u53cb\u6709\u5e2e\u52a9\u3002 \u663e\u793a\u6700\u8fd1\u6587\u7ae0\uff1a < ?php wp_get_archives('type=postbypost&#038;limit=5'); ?> \u6216\u8005\uff1a < ?php $recentposts = get_posts('numberposts=12&#038;category=4'); foreach ($recentposts as $post) : setup_postdata($post); ?><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[543,551],"class_list":["post-1572","post","type-post","status-publish","format-standard","hentry","category-create-themes","tag-wordpress-theme","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1572","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=1572"}],"version-history":[{"count":0,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/1572\/revisions"}],"wp:attachment":[{"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}