{"id":2271,"date":"2011-05-09T09:39:16","date_gmt":"2011-05-09T01:39:16","guid":{"rendered":"https:\/\/www.wopus.org\/?p=2271"},"modified":"2011-05-09T09:39:16","modified_gmt":"2011-05-09T01:39:16","slug":"wordpress%e7%9a%84tumblr%e5%8c%96%ef%bc%9apost-format%e5%8a%9f%e8%83%bd%e5%b0%8f%e8%af%95","status":"publish","type":"post","link":"https:\/\/wopus.org\/?p=2271","title":{"rendered":"WordPress\u7684Tumblr\u5316\uff1aPost format\u529f\u80fd\u5c0f\u8bd5"},"content":{"rendered":"<p>\u4e3b\u673a\u653e\u5728\u56fd\u5916\u7684\u4e00\u4e2a\u597d\u5904\u5c31\u662f\u5347\u7ea7 WordPress \u53d8\u5f97\u5f88\u65b9\u4fbf\uff0c\u770b\u5230 Dashboard \u91cc\u63d0\u793a\u6709\u65b0\u7684 WordPress \u7248\u672c\u4e4b\u540e\u5c31\u968f\u624b\u70b9\u51e0\u4e0b\uff0c\u65b0\u7248\u672c\u5c31\u81ea\u52a8\u88c5\u597d\u4e86\u3002\u8fd9\u4efd\u65b9\u4fbf\u4e5f\u8ba9 Lucifr \u5f88\u5c11\u518d\u53bb\u7814\u7a76\u65b0\u7248\u672c\u7684\u529f\u80fd\uff0c\u4ee5\u81f3\u4e8e\u5dee\u70b9\u9519\u8fc7\u4e86 WordPress 3.1 \u4e2d\u8fd9\u4e2a\u5f88\u4e0d\u8be5\u5ffd\u89c6\u7684\u00a0<a title=\"Post Formats \u00ab WordPress Codex\" href=\"http:\/\/codex.wordpress.org\/Post_Formats\">Post format<\/a> (\u6587\u7ae0\u683c\u5f0f) \u529f\u80fd\u3002<\/p>\n<h2>\u4ec0\u4e48\u662f Post format<\/h2>\n<p>\u5982\u679c\u63a5\u89e6\u8fc7\u00a0<a title=\"Tumblr\" href=\"http:\/\/tumblr.com\/\">Tumblr<\/a> \u8fd9\u4e2a\u201c\u4e0d\u5b58\u5728\u201d\u7684\u535a\u5ba2\u670d\u52a1\u7684\u8bdd\uff0c\u53ef\u80fd\u4f1a\u66f4\u52a0\u5bb9\u6613\u7406\u89e3 Post format\u3002\u7b80\u5355\u6765\u8bf4 Post format \u5c31\u50cf\u662f\u4e00\u79cd\u9488\u5bf9\u4e3b\u9898\u7684\u901a\u7528\u7c7b\u522b(Category)\uff0c\u901a\u8fc7 Post format \u53ef\u4ee5\u5c06\u6587\u7ae0\u5206\u4e3a\u51e0\u7c7b\uff0c\u4ece\u800c\u65b9\u4fbf\u4e3b\u9898(Theme)\u9488\u5bf9\u4e0d\u540c\u7684\u7c7b\u522b\u91c7\u7528\u76f8\u5e94\u7684\u663e\u793a\u98ce\u683c\u3002<\/p>\n<h2>\u6709\u54ea\u4e9b Post format<\/h2>\n<p>\u76ee\u524d WordPress 3.1 \u5df2\u7ecf\u652f\u6301\u7684 Post format \u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\uff1a<\/p>\n<ul>\n<li>aside<\/li>\n<li>gallery<\/li>\n<li>link<\/li>\n<li>image<\/li>\n<li>quote<\/li>\n<li>status<\/li>\n<li>video<\/li>\n<li>audio<\/li>\n<li>chat<\/li>\n<\/ul>\n<p>\u5b9e\u9645\u4e0a\u9664\u4e86\u8fd9\u4e9b\u4ee5\u5916\u8fd8\u6709\u4e00\u4e2a\u5c31\u662f\u666e\u901a\u7c7b\u578b\u7684 standard\uff0c\u901a\u5e38\u53ef\u4ee5\u4f5c\u4e3a\u4f20\u7edf\u610f\u4e49\u4e0a\u7684\u957f\u6587\u7ae0\u6765\u5bf9\u5f85\uff0c\u672a\u6307\u5b9a post format \u7684\u6587\u7ae0\u90fd\u88ab\u5f52\u4e3a\u6b64\u7c7b\u3002<\/p>\n<p>\u53ef\u4ee5\u770b\u51fa\uff0c\u548c Tumblr \u7c7b\u4f3c\uff0c\u8fd9\u4e9b Post format \u57fa\u672c\u4e0a\u6db5\u76d6\u4e86\u5404\u79cd\u6587\u7ae0\u7c7b\u578b\uff0c\u4f46\u4e0e\u4e4b\u524d\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u201c\u7c7b\u522b\u201d\u4e0d\u540c\uff0cPost format \u662f\u7531 WordPress \u5b98\u65b9\u5b9a\u4e49\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e3b\u9898\u521b\u4f5c\u8005\u53ea\u53ef\u4ee5\u4ece\u8fd9\u4e9b\u5206\u7c7b\u4e2d\u8fdb\u884c\u9009\u62e9\uff0c\u5e76\u4e3a\u76f8\u5e94\u7684\u5206\u7c7b\u5236\u4f5c\u51fa\u5bf9\u5e94\u7684\u98ce\u683c\u6765\u3002\u8fd9\u5c31\u786e\u4fdd\u4e86\u7528\u6237\u5728\u4e0d\u540c\u4e3b\u9898\u4e4b\u95f4\u5207\u6362\u65f6\uff0cPost format \u4fdd\u6301\u4e86\u4e00\u81f4\u6027\u3002\u5728\u8fd9\u4e00\u70b9\u4e0a\u548c Tumblr \u7684\u7406\u5ff5\u4e5f\u662f\u4e00\u6837\u7684\u3002<\/p>\n<h2>\u5982\u4f55\u4e3a\u4e3b\u9898\u6dfb\u52a0 Post format \u529f\u80fd<\/h2>\n<p>\u7531\u4e8e Post format \u57fa\u672c\u4e0a\u662f\u4e3a\u4e3b\u9898\u5236\u4f5c\u8005\u8bbe\u7f6e\u7684\uff0c\u5bf9\u4e8e\u666e\u901a\u7528\u6237\u6765\u8bf4\uff0c\u53ef\u80fd\u4e3a\u65e2\u6709\u4e3b\u9898\u6dfb\u52a0 Post format \u529f\u80fd\uff0c\u5e76\u8fbe\u5230\u5982 Tumblr \u4f17\u591a\u7cbe\u7f8e\u4e3b\u9898\u7684\u98ce\u683c\u6c34\u51c6\u5e76\u4e0d\u662f\u4ef6\u5f88\u5bb9\u6613\u7684\u4e8b\u3002\u6240\u4ee5\u4ee5\u4e0b\u7684\u5185\u5bb9\u4e5f\u53ea\u662f\u4f9b\u53c2\u8003\uff0c\u5e76\u4e0d\u662f\u8be6\u7ec6\u7684\u6559\u7a0b\u3002<\/p>\n<h3>\u6dfb\u52a0\u4e3b\u9898\u652f\u6301<\/h3>\n<p>\u9700\u8981\u5728\u4e3b\u9898\u7684 function.php \u4e2d\u6dfb\u52a0\u00a0<a title=\"Function Reference\/add theme support \u00ab WordPress Codex\" href=\"http:\/\/codex.wordpress.org\/Function_Reference\/add_theme_support\">add_theme_support()<\/a> \u6765\u544a\u8bc9 WordPress \u4e3b\u9898\u4e2d\u9700\u8981\u6fc0\u6d3b\u7684 Post format \u7c7b\u578b\u3002\u5982\uff1a<\/p>\n<pre><span><code>add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );\n<\/code><\/span><\/pre>\n<p>\u8fd9\u6837\u5c31\u5f00\u542f\u4e86\u5bf9 aside \u548c gallery \u8fd9\u4e24\u79cd Post format \u7684\u652f\u6301\u3002\u8fd9\u65f6\u5728 WordPress \u540e\u53f0\u7684\u7f16\u8f91\u6587\u7ae0\u9875\u9762\u5c31\u53ef\u4ee5\u770b\u5230\u76f8\u5e94\u7684 Post format \u9009\u9879\uff0c\u5e76\u4e3a\u6587\u7ae0\u6307\u5b9a\u76f8\u5e94\u7684 Post format \u4e86\u3002<\/p>\n<p><a title=\"post-format-backend\" href=\"http:\/\/farm6.static.flickr.com\/5184\/5592652990_364ba8032a_o.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm6.static.flickr.com\/5184\/5592652990_364ba8032a_o.png\" alt=\"post-format-backend\" width=\"303\" height=\"176\" \/><\/a><\/p>\n<h3>\u5728\u4e3b\u9898\u4e2d\u6574\u5408 Post format<\/h3>\n<p>\u7ecf\u8fc7\u4e0a\u8ff0\u8fd9\u4e00\u6b65\uff0c\u53ea\u662f\u6dfb\u52a0\u4e86\u4e3b\u9898\u5bf9 Post format \u7684\u652f\u6301\u800c\u5df2\uff0c\u8981\u5728\u524d\u53f0\u663e\u793a\u51fa\u4e0d\u540c format \u4e4b\u95f4\u5728\u98ce\u683c\u4e0a\u7684\u533a\u522b\uff0c\u8fd9\u624d\u662f\u4e3b\u9898\u5236\u4f5c\u4e0a\u7684\u91cd\u5934\u620f\uff0c\u4e5f\u7559\u7ed9\u4e86\u521b\u4f5c\u8005\u5f88\u5927\u65bd\u5c55\u7684\u7a7a\u95f4\u3002<\/p>\n<p>\u5982\u4f55\u5c06\u4e0d\u540c\u7684\u7c7b\u578b\u7684\u6587\u7ae0\u5c55\u793a\u51fa\u4e0d\u540c\u7684\u98ce\u683c\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u901a\u8fc7\u6761\u4ef6\u8bed\u53e5\u52a0\u4e0a CSS \u7684\u63a7\u5236\u6765\u8fbe\u5230\u7684\u3002<\/p>\n<p>\u76ee\u524d Lucifr \u5c31\u5728\u4fee\u6539\u4f7f\u7528\u4e2d\u7684\u8fd9\u4e2a\u4e3b\u9898\uff0c\u4ee5\u8ba9\u5176\u5b9e\u73b0 Post format \u529f\u80fd\uff0c\u4ee5 aside \u7c7b\u522b\u7684\u6dfb\u52a0\u4e3a\u4f8b\uff1a<\/p>\n<pre><span><code>&lt;?php if ( has_post_format( 'aside' )) { ?&gt;\n    &lt;div class=\"post clearfix format-aside\"&gt;\n        &lt;a class=\"view_post\" title=\"&lt;?php the_title(); ?&gt;\" href=\"&lt;?php the_permalink(); ?&gt;\"&gt;Permalink for this post&lt;\/a&gt;\n        &lt;div class=\"aside-pointer\"&gt;&lt;\/div&gt;\n        &lt;div class=\"aside-entry\"&gt;\n        &lt;?php the_content(); ?&gt;\n        &lt;\/div&gt;\n    &lt;\/div&gt;\n&lt;?php }else { ?&gt;\n<\/code><\/span><\/pre>\n<p>\u5728\u663e\u793a\u6587\u7ae0\u5217\u8868\u7684 entry.php \u4e2d\u6dfb\u52a0\u4e86\u4ee5\u4e0a\u7684\u4ee3\u7801\u4e4b\u540e\uff0c\u5c31\u4e3a aside \u521b\u5efa\u51fa\u4e86\u4e00\u4e2a\u7279\u6b8a\u7684\u683c\u5f0f\uff0c\u914d\u5408\u4e00\u4e9b CSS\uff1a<\/p>\n<pre><span><code>.aside-entry {\n    background: none repeat scroll 0 0 #FFFFFF;\n    border-radius: 4px 4px 4px 4px;\n    box-shadow: 1px 1px 1px #A0A0A0;\n    padding: 12px 30px;\n    color: #666666;\n    font-size: 14px;\n}\n\n.aside-entry a {\n    color: #3174A3;\n}\n\n.aside-pointer {\n    background: url(\"images\/aside-pointer.png\") no-repeat scroll 0 0 transparent;\n    display: block;\n    height: 17px;\n    margin: 12px 0 0 -13px;\n    position: absolute;\n    width: 13px;\n}\n<\/code><\/span><\/pre>\n<p>\u5c31\u53ef\u4ee5\u663e\u793a\u51fa\u4e0e\u6b63\u5e38(standard)\u6587\u7ae0\u4e0d\u540c\u7684\u98ce\u683c\uff1a<\/p>\n<p><a title=\"post-format-aside\" href=\"http:\/\/farm6.static.flickr.com\/5223\/5592102505_1025d1072e_b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm6.static.flickr.com\/5223\/5592102505_1025d1072e.jpg\" alt=\"post-format-aside\" width=\"500\" height=\"360\" \/><\/a><\/p>\n<p>\u5982\u56fe\u6240\u793a\uff0c\u4e0a\u65b9\u7684 aside \u5c5e\u4e8e\u7b80\u77ed\u5f62\u5f0f\u7684\u4e0d\u91cd\u8981\u7684\u6587\u7ae0\uff0c\u6240\u4ee5\u4e00\u5207\u4ece\u7b80\uff0c\u6807\u9898\u3001\u4f5c\u8005\u3001\u53d1\u8868\u65f6\u95f4\u7b49\u4fe1\u606f\u90fd\u4e0d\u4e88\u663e\u793a\u3002<\/p>\n<p>\u540c\u7406\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4e3a\u5176\u5b83\u7684 Post format \u521b\u9020\u51fa\u72ec\u7279\u7684\u98ce\u683c\u6765\u3002<\/p>\n<p>\u53ea\u8981\u6309\u7167\u8fd9\u6837\u7684\u5199\u6cd5\u5c31\u53ef\u4ee5\u4e86\uff1a<\/p>\n<pre><span><code>&lt;?php if ( has_post_format( 'aside' )) { ?&gt;\n    \u8fd9\u91cc\u5199\u5165 aside \u7684\u683c\u5f0f\n&lt;?php } else if (has_post_format('gallery')) { ?&gt;\n    \u8fd9\u91cc\u5199\u5165 gallery \u7684\u683c\u5f0f\n&lt;?php } else if (has_post_format('link')) { ?&gt;\n    \u8fd9\u91cc\u5199\u5165 link \u7684\u683c\u5f0f\n...\n&lt;?php }else { ?&gt;\n    \u6700\u540e\u662f\u666e\u901a\u683c\u5f0f\n&lt;?php } ?&gt;\n<\/code><\/span><\/pre>\n<p>\u8fd9\u6837\u7684\u5199\u6cd5\u9002\u5408\u5404\u79cd Post format \u4e4b\u95f4\u5dee\u522b\u5f88\u5927\u7684\u60c5\u51b5\uff0c\u5982\u679c\u662f\u53ef\u4ee5\u901a\u8fc7 CSS \u8fdb\u884c\u8c03\u6574\u7684\u5c0f\u4fee\u6539\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u6d3b\u7528\u00a0<a title=\"Function Reference\/post class \u00ab WordPress Codex\" href=\"http:\/\/codex.wordpress.org\/Template_Tags\/post_class\">post_class()<\/a> \u51fd\u6570\u7684\u65b9\u5f0f\u914d\u5408 CSS \u6765\u8fbe\u5230\u76ee\u7684.\u6bd4\u5982\uff1a<\/p>\n<pre><span><code>&lt;div id=\"post-&lt;?php the_ID(); ?&gt;\" &lt;?php post_class(); ?&gt;&gt;\n    &lt;h2 class=\"post-title\"&gt;&lt;a href=\"&lt;?php the_permalink(); ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h2&gt;\n    &lt;?php the_content(); ?&gt;\n&lt;\/div&gt;\n<\/code><\/span><\/pre>\n<p>\u914d\u5408 CSS\uff1a<\/p>\n<pre><span><code>.format-aside .post-title {\n    display:none;\n}\n<\/code><\/span><\/pre>\n<p>\u5c31\u8fbe\u5230\u4e86\u53ea\u5728 aside \u7c7b\u578b\u4e2d\u9690\u85cf\u6587\u7ae0\u6807\u9898\u7684\u4f5c\u7528\uff0c\u540c\u7406\u4e5f\u53ef\u4ee5\u8c03\u6574\u5b57\u4f53\u3001\u80cc\u666f\u7b49\u7b49\u3002<\/p>\n<h2>\u540e\u8bb0<\/h2>\n<p>Post format \u529f\u80fd\u662f WordPress \u5411 Tumblr \u7684\u4e00\u6b21\u5b66\u4e60\uff0c\u5728\u6211\u770b\u6765\uff0c\u8fd9\u53cd\u6620\u51fa\u5f00\u53d1\u8005\u4eec\u8ba4\u8bc6\u5230\u4e86 WordPress \u5728\u4e2a\u4eba\u4f7f\u7528\u65f6\u8fd8\u4e0d\u591f\u7b80\u5355\u3001\u7eaf\u7cb9\u3002<\/p>\n<p>\u76ee\u524d\u5df2\u7ecf\u6709\u4e00\u4e9b\u5546\u7528\u4e3b\u9898\u5f00\u59cb\u652f\u6301 Post format\uff0c\u76f8\u4fe1\u4e4b\u540e\u4e2a\u4eba\u7528 WordPress \u4e3b\u9898\u4f1a\u6d8c\u73b0\u51fa\u66f4\u591a\u7684 Tumblr \u98ce\u683c\u5427\u3002<\/p>\n<p>\u672c\u6587\u8f6c\u8f7d\u81ea\uff1a<a href=\"http:\/\/lucifr.com\/40068\/wordpress-3-1-getting-more-tumblrized-with-post-format\/\" target=\"_blank\">http:\/\/lucifr.com\/40068\/wordpress-3-1-getting-more-tumblrized-with-post-format\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3b\u673a\u653e\u5728\u56fd\u5916\u7684\u4e00\u4e2a\u597d\u5904\u5c31\u662f\u5347\u7ea7 WordPress \u53d8\u5f97\u5f88\u65b9\u4fbf\uff0c\u770b\u5230 Dashboard \u91cc\u63d0\u793a\u6709\u65b0\u7684 WordPress \u7248\u672c\u4e4b\u540e\u5c31\u968f\u624b\u70b9\u51e0\u4e0b\uff0c\u65b0\u7248\u672c\u5c31\u81ea\u52a8\u88c5\u597d\u4e86\u3002\u8fd9\u4efd\u65b9\u4fbf\u4e5f\u8ba9 Lucifr \u5f88\u5c11\u518d\u53bb\u7814\u7a76\u65b0\u7248\u672c\u7684\u529f\u80fd\uff0c\u4ee5\u81f3\u4e8e\u5dee\u70b9\u9519\u8fc7\u4e86 WordPress 3.1 \u4e2d\u8fd9\u4e2a\u5f88\u4e0d\u8be5\u5ffd\u89c6\u7684\u00a0Post format (\u6587\u7ae0\u683c\u5f0f) \u529f\u80fd\u3002 \u4ec0\u4e48\u662f Post format \u5982\u679c\u63a5\u89e6\u8fc7\u00a0Tumblr \u8fd9\u4e2a\u201c\u4e0d\u5b58\u5728\u201d\u7684\u535a\u5ba2\u670d\u52a1\u7684\u8bdd\uff0c\u53ef\u80fd\u4f1a\u66f4\u52a0\u5bb9\u6613\u7406\u89e3 Post format\u3002\u7b80\u5355\u6765\u8bf4 Post format \u5c31\u50cf\u662f\u4e00\u79cd\u9488\u5bf9\u4e3b\u9898\u7684\u901a\u7528\u7c7b\u522b(Category)\uff0c\u901a\u8fc7 Post format \u53ef\u4ee5\u5c06\u6587\u7ae0\u5206\u4e3a\u51e0\u7c7b\uff0c\u4ece\u800c\u65b9\u4fbf\u4e3b\u9898(Theme)\u9488\u5bf9\u4e0d\u540c\u7684\u7c7b\u522b\u91c7\u7528\u76f8\u5e94\u7684\u663e\u793a\u98ce\u683c\u3002 \u6709\u54ea\u4e9b Post format \u76ee\u524d WordPress 3.1 \u5df2\u7ecf\u652f\u6301\u7684 Post format \u5206\u4e3a\u4ee5\u4e0b\u51e0\u4e2a\uff1a aside gallery link image quote status video audio chat \u5b9e\u9645\u4e0a\u9664\u4e86\u8fd9\u4e9b\u4ee5\u5916\u8fd8\u6709\u4e00\u4e2a\u5c31\u662f\u666e\u901a\u7c7b\u578b\u7684 standard\uff0c\u901a\u5e38\u53ef\u4ee5\u4f5c\u4e3a\u4f20\u7edf\u610f\u4e49\u4e0a\u7684\u957f\u6587\u7ae0\u6765\u5bf9\u5f85\uff0c\u672a\u6307\u5b9a post format \u7684\u6587\u7ae0\u90fd\u88ab\u5f52\u4e3a\u6b64\u7c7b\u3002 \u53ef\u4ee5\u770b\u51fa\uff0c\u548c Tumblr \u7c7b\u4f3c\uff0c\u8fd9\u4e9b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[269,770,781],"class_list":["post-2271","post","type-post","status-publish","format-standard","hentry","category-diy-themes","tag-tumblr","tag-770","tag-781"],"_links":{"self":[{"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/2271","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=2271"}],"version-history":[{"count":0,"href":"https:\/\/wopus.org\/index.php?rest_route=\/wp\/v2\/posts\/2271\/revisions"}],"wp:attachment":[{"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wopus.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}