{"id":939,"date":"2012-01-30T02:20:32","date_gmt":"2012-01-29T17:20:32","guid":{"rendered":"http:\/\/nanoappli.com\/blog\/?p=939"},"modified":"2016-06-14T23:35:20","modified_gmt":"2016-06-14T14:35:20","slug":"wordpress%e4%bb%8a%e6%9c%88%e3%81%ae%e6%8a%95%e7%a8%bf%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%97%e3%81%a6%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8b","status":"publish","type":"post","link":"http:\/\/nanoappli.com\/blog\/archives\/939","title":{"rendered":"[WordPress]\u4eca\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\u3055\u305b\u308b"},"content":{"rendered":"<p>\n<img loading=\"lazy\" src=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_05.jpg\" alt=\"\" title=\"20120130_05\" width=\"366\" height=\"159\" class=\"alignnone size-full wp-image-944\" \/>\n<br \/>\nWordPress\u3067\u3001\u5f53\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3066\u753b\u9762\u306b\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u3061\u3087\u3063\u3068\u30c6\u30b9\u30c8\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u3046\u307e\u304f\u3044\u3063\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\n<br \/>\n<br \/>\n<h2>\u3084\u308a\u305f\u3044\u3053\u3068<\/h2>\n\u6bce\u65e5Blog\u3092\u6b20\u304b\u3055\u305a\u66f8\u304f\u7fd2\u6163\u3065\u3051\u3092\u884c\u3044\u305f\u3044\u3002<br \/>\n\u305f\u304f\u3055\u3093\u306e\u8a18\u4e8b\u3092\u63d0\u4f9b\u3057\u305f\u3044\u3002<br \/>\n<br \/>\n<br \/>\n<h2>\u8003\u3048\u305f\u3053\u3068\u3001\u3084\u308a\u305f\u3044\u3053\u3068<\/h2>\n<ul>\n    <li>\u300c\u6bce\u65e5\u304c\u3093\u3070\u308b\u300d\u7684\u306a\u7cbe\u795e\u8ad6\u3060\u3068\u98fd\u304d\u308b\u306e\u3067\u3001Blog\u306e\u6295\u7a3f\u3092\u3059\u308b\u70ba\u306e\u52d5\u6a5f\u4ed8\u3051\u3092\u4f5c\u308a\u305f\u3044\u3002<\/li>\n    <li>\u8a08\u6e2c\u3067\u304d\u308b\u3082\u306e\u306f\u6539\u5584\u3067\u304d\u308b\u3002\u306a\u3001\u306f\u305a\u3002<\/li>\n    <li>\u305d\u306e\u304d\u3063\u304b\u3051\u3068\u3057\u3066\u3001\u5e38\u306b\u524d\u6708\u306e\u6295\u7a3f\u6570\u5b9f\u7e3e\u3068\u6bd4\u8f03\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002<\/li>\n    <li>\u53d6\u5f97\u3057\u305f\u5b9f\u7e3e\u306f\u3001\u7ba1\u7406\u30da\u30fc\u30b8\u306e\u30c8\u30c3\u30d7\u306b\u5e38\u306b\u8868\u793a\u3055\u305b\u305f\u3044\u3002<\/li>\n<\/ul>\n<br \/>\n\u3044\u304d\u306a\u308a\u76ee\u6a19\u306b\u5230\u9054\u3059\u308b\u306b\u306f\u30cf\u30fc\u30c9\u30eb\u304c\u9ad8\u3044\u306e\u3067\u3001\u307e\u305a\u306f\u8abf\u67fb\u3092\u517c\u306d\u3066\u3001WordPress\u306e\u5f53\u6708\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3001\u6295\u7a3f\u6570\uff0b\u7d2f\u7a4d\u6570\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002<br \/>\n<br \/>\n<br \/>\n<h2>\u30c7\u30fc\u30bf\u306e\u53d6\u5f97<\/h2>\n\u307e\u305a\u306f\u3001\u76ee\u7684\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u306e\u78ba\u8a8d\u3067\u3059\u3002<br \/>\n<br \/>\nMySQL\u306eDB\u3092\u76f4\u63a5\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3068\u3053\u308d\u3001\u6295\u7a3f\u30c7\u30fc\u30bf\u306fwp1_posts\u30c6\u30fc\u30d6\u30eb\u306b\u5165\u3063\u3066\u3044\u3063\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u3067\u3059\u304c\u3001WordPress\u306e\u5834\u5408\u306f\u30c6\u30fc\u30d6\u30eb\u540d\u306e\u63a5\u982d\u8a9e\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306b\u6307\u5b9a\u53ef\u80fd\u306a\u306e\u3067\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u3001\u4e0a\u8a18\u30c6\u30fc\u30d6\u30eb\u3092\u76f4\u66f8\u304d\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n<br \/>\n\u3067\u306f\u3001\u3069\u3046\u3059\u308b\u304b\u3068\u3044\u3046\u3068\u3001WordPress\u3067\u306f\u4ee5\u4e0b\u306e\u5909\u6570\u3067\u4e0a\u8a18\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u306e\u5909\u6570\u306fDB\u306e\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3082\u3057\u3066\u3044\u308b\u306e\u3067\u3001$wpdb->get_results()\u3067SQL\u304c\u76f4\u63a5\u767a\u884c\u3067\u304d\u307e\u3059\u3002<br \/>\n<pre lang=\"php\">\n$wpdb->posts\n<\/pre>\n<br \/>\n\u4ed5\u7d44\u307f\u306f\u5206\u304b\u3063\u305f\u306e\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u30c7\u30fc\u30bf\u306e\u4e2d\u8eab\u3092\u3092\u76f4\u63a5\u30c1\u30a7\u30c3\u30af\u3057\u305f\u3068\u3053\u308d\u3001\u30c7\u30fc\u30bf\u306e\u53d6\u5f97\u306f\u4ee5\u4e0b\u306e\u95a2\u6570\u3067\u3068\u308c\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n<pre lang=\"php\">\n<?php\n\/\/------------------------------\n\/\/ \u4eca\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3059\u308b\n\/\/------------------------------\nfunction getThisMonthEntryQty( $wpdb ) {\n    $sql = <<<QUERY\n        SELECT   DATE_FORMAT( POST_DATE, '%Y%m%d') targetdate,\n                 COUNT(*)                          count \n        FROM     $wpdb->posts\n        WHERE    POST_TYPE   =  'post'\n        AND      POST_STATUS =  'publish'\n        AND      POST_DATE   >= CONCAT( DATE_FORMAT( NOW(), '%Y%m'), '01' )\n        GROUP BY date_format( POST_DATE, '%Y%m%d')\n        ORDER BY POST_DATE\nQUERY;\n\n    return $wpdb->get_results( $sql );\n}\n?>\n<\/pre>\n<br \/>\n<h2>\u8868\u793a\u5074\u306e\u30ed\u30b8\u30c3\u30af<\/h2>\n<br \/>\n\u8868\u793a\u5074\u306f\u3053\u3093\u306a\u611f\u3058\u3002<br \/>\n\u672c\u5f53\u306f\u30b0\u30e9\u30d5\u306b\u3057\u305f\u3044\u3051\u3069\u3001\u4eca\u56de\u306f\u5b9f\u9a13\u306a\u306e\u3067\u8868\u5f62\u5f0f\u3067\u51fa\u529b\u3055\u305b\u307e\u3059\u3002<br \/>\n<pre lang=\"html\">\n<h2>\u4eca\u6708\u306e\u6295\u7a3f\u6570<\/h2>\n<table>\n    <tr>\n        <th>\u65e5\u4ed8<\/th>\n        <th>\u6295\u7a3f\u6570<\/th>\n        <th>\u7d2f\u7a4d\u6295\u7a3f\u6570<\/th>\n    <\/tr>\n    <?php $totalcount = 0; ?>\n    <?php foreach ( getThisMonthEntryQty( $wpdb ) as $d ) { ?>\n    <?php $totalcount += $d->count; ?>\n        <tr>\n            <td><?php echo $d->targetdate; ?><\/td>\n            <td><?php echo $d->count;      ?><\/td>\n            <td><?php echo $totalcount;    ?><\/td>\n        <\/tr>\n    <?php } ?>\n<\/table>\n<\/pre>\n<br \/>\n<br \/>\n<br \/>\n<h2>\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n<br \/>\n\u3068\u308a\u3042\u3048\u305a\u306e\u30c6\u30b9\u30c8\u3068\u3057\u3066\u3001single.php\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9(\u3068\u95a2\u6570\u5b9a\u7fa9)\u3092\u8ffd\u52a0\u3057\u3001\u753b\u9762\u3092\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3059\u3002<br \/>\n<a href=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_04.jpg\"><img loading=\"lazy\" src=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_04.jpg\" alt=\"\" title=\"20120130_04\" width=\"374\" height=\"493\" class=\"alignnone size-full wp-image-941\" srcset=\"http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_04.jpg 374w, http:\/\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_04-227x300.jpg 227w\" sizes=\"(max-width: 374px) 100vw, 374px\" \/><\/a><br \/>\n<br \/>\n\u671f\u5f85\u3057\u305f\u7d50\u679c\u304c\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n<br \/>\n<br \/>\n<br \/>\n<h2>TODO<\/h2>\n\u3053\u306e\u6b21\u306b\u3084\u308a\u305f\u3044\u3053\u3068\u30e1\u30e2\u3067\u3059\u3002<br \/>\n<ul>\n    <li>\u3053\u306e\u8868\u793a\u3092\u7ba1\u7406\u30da\u30fc\u30b8\u3067\u95b2\u89a7\u53ef\u80fd\u306b\u3059\u308b\u3002<\/li>\n    <li>\u7d50\u679c\u3092\u7a4d\u307f\u4e0a\u3052\u30b0\u30e9\u30d5\u3067\u8868\u793a\u53ef\u80fd\u306b\u3059\u308b\u3002<\/li>\n    <li>\u5f53\u6708\u306e\u7d2f\u7a4d\u6295\u7a3f\u6570\u3068\u3001\u524d\u6708\u3092\u6bd4\u8f03\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/li>\n<\/ul>\n<br \/>\n\u7ba1\u7406\u30da\u30fc\u30b8\u306b\u8868\u793a\u3055\u305b\u308b\u305f\u3081\u306b\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u3089\u306a\u3051\u308c\u3070\u3044\u3051\u306a\u3044\u306f\u305a\u306a\u306e\u3067\u3001\u305d\u306e\u8fba\u306e\u8abf\u67fb\u304c\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<br \/>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u3067\u3001\u5f53\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3066\u753b\u9762\u306b\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002 \u3061\u3087\u3063\u3068\u30c6\u30b9\u30c8\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u3001\u3046\u307e\u304f\u3044\u3063\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\u3002 \u3084\u308a\u305f\u3044\u3053\u3068 \u6bce\u65e5Blog\u3092\u6b20\u304b\u3055\u305a\u66f8\u304f\u7fd2\u6163\u3065\u3051\u3092\u884c\u3044\u305f\u3044\u3002 \u305f\u304f\u3055\u3093\u306e\u8a18\u4e8b\u3092\u63d0\u4f9b\u3057\u305f\u3044\u3002 \u8003\u3048\u305f\u3053\u3068\u3001\u3084\u308a\u305f\u3044\u3053\u3068 \u300c\u6bce\u65e5\u304c\u3093\u3070\u308b\u300d\u7684\u306a\u7cbe\u795e\u8ad6\u3060\u3068\u98fd\u304d\u308b\u306e\u3067\u3001Blog\u306e\u6295\u7a3f\u3092\u3059\u308b\u70ba\u306e\u52d5\u6a5f\u4ed8\u3051\u3092\u4f5c\u308a\u305f\u3044\u3002 \u8a08\u6e2c\u3067\u304d\u308b\u3082\u306e\u306f\u6539\u5584\u3067\u304d\u308b\u3002\u306a\u3001\u306f\u305a\u3002 \u305d\u306e\u304d\u3063\u304b\u3051\u3068\u3057\u3066\u3001\u5e38\u306b\u524d\u6708\u306e\u6295\u7a3f\u6570\u5b9f\u7e3e\u3068\u6bd4\u8f03\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3002 \u53d6\u5f97\u3057\u305f\u5b9f\u7e3e\u306f\u3001\u7ba1\u7406\u30da\u30fc\u30b8\u306e\u30c8\u30c3\u30d7\u306b\u5e38\u306b\u8868\u793a\u3055\u305b\u305f\u3044\u3002 \u3044\u304d\u306a\u308a\u76ee\u6a19\u306b\u5230\u9054\u3059\u308b\u306b\u306f\u30cf\u30fc\u30c9\u30eb\u304c\u9ad8\u3044\u306e\u3067\u3001\u307e\u305a\u306f\u8abf\u67fb\u3092\u517c\u306d\u3066\u3001WordPress\u306e\u5f53\u6708\u6295\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[13],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2542,"url":"http:\/\/nanoappli.com\/blog\/archives\/2542","url_meta":{"origin":939,"position":0},"title":"[C#]\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30ab\u30a6\u30f3\u30bf\u304b\u3089\u53d6\u5f97\u3057\u305f\u5024\u306e\u5c65\u6b74\u3092,\u4e00\u5b9a\u4ef6\u6570\u899a\u3048\u3066\u304a\u304f","date":"2012\u5e745\u670818\u65e5","format":false,"excerpt":"Windows\u306b\u6a19\u6e96\u3067\u642d\u8f09\u3055\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u3067\u306f\u3001PC\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/05\/20120518_03-500x333.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3004,"url":"http:\/\/nanoappli.com\/blog\/archives\/3004","url_meta":{"origin":939,"position":1},"title":"[Research Artisan]\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u3092RSS\u914d\u4fe1\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3","date":"2012\u5e745\u670830\u65e5","format":false,"excerpt":"\u30d5\u30ea\u30fc\u306ePHP\u88fd\u30a2\u30af\u30bb\u30b9\u30ed\u30b0\u89e3\u6790\u30bd\u30d5\u30c8\u3068\u3057\u3066\u6709\u540d\u306aReserch Artisan Lite\u3067\u3059\u304c\u3001\u53d6\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/05\/20120530_01-500x217.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7881,"url":"http:\/\/nanoappli.com\/blog\/archives\/7881","url_meta":{"origin":939,"position":2},"title":"[WordPress] Rest API\u306b\u95a2\u3059\u308b\u60c5\u5831\u30b5\u30a4\u30c8\u4e00\u89a7","date":"2017\u5e741\u67085\u65e5","format":false,"excerpt":"[WordPress] Rest API\u306b\u95a2\u3059\u308b\u60c5\u5831\u30b5\u30a4\u30c8\u4e00\u89a7 \u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 REST\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7807,"url":"http:\/\/nanoappli.com\/blog\/archives\/7807","url_meta":{"origin":939,"position":3},"title":"[WordPress]shortcode\u3067\u8a18\u4e8b\u30bf\u30a4\u30c8\u30eb\u3084\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30c9\u306e\u5185\u5bb9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5","date":"2016\u5e7412\u670831\u65e5","format":false,"excerpt":"shortcode\u3067\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3059\u308b WordPress\u3067\u306f\u3001\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2883,"url":"http:\/\/nanoappli.com\/blog\/archives\/2883","url_meta":{"origin":939,"position":4},"title":"Research Artisan Lite\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u89e3\u6790\u30e1\u30e2","date":"2012\u5e745\u670826\u65e5","format":false,"excerpt":"\u30c7\u30fc\u30bf\u96c6\u8a08\u5468\u308a\u306e\u30ed\u30b8\u30c3\u30af\u3092\u8abf\u67fb\u3057\u305f\u3068\u304d\u306e\u30e1\u30e2\u3002 \u30bd\u30fc\u30b9\u3092\u8abf\u67fb\u3057\u305f\u76ee\u7684\u306f\u3001Research Artis\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1967,"url":"http:\/\/nanoappli.com\/blog\/archives\/1967","url_meta":{"origin":939,"position":5},"title":"AmazonMWS\u3067\u6ce8\u6587\u3055\u308c\u305f\u5546\u54c1\u306e\u30b3\u30f3\u30c7\u30a3\u30b7\u30e7\u30f3\u30fb\u30b3\u30e1\u30f3\u30c8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5","date":"2012\u5e743\u670828\u65e5","format":false,"excerpt":"\u672c\u8a18\u4e8b\u3067\u306f\u3001Amazon\u306e\u30de\u30fc\u30b1\u30c3\u30c8\u30d7\u30ec\u30fc\u30b9\u5927\u53e3\u51fa\u54c1\u8005\u304c\u5229\u7528\u3067\u304d\u308bMarketplace\u3000WebSe\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/939"}],"collection":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/comments?post=939"}],"version-history":[{"count":12,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/939\/revisions"}],"predecessor-version":[{"id":953,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/939\/revisions\/953"}],"wp:attachment":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/media?parent=939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/categories?post=939"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/tags?post=939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}