{"id":1682,"date":"2019-02-27T20:25:09","date_gmt":"2019-02-27T11:25:09","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1682"},"modified":"2019-02-27T20:25:27","modified_gmt":"2019-02-27T11:25:27","slug":"%e6%9c%88%e5%88%a5%e3%82%a2%e3%83%bc%e3%82%ab%e3%82%a4%e3%83%96%e3%82%92%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%a7%e6%9c%88%e3%81%94%e3%81%a8%e3%81%ab%e8%aa%ad%e3%81%bf%e8%be%bc%e3%81%bf","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/%e6%9c%88%e5%88%a5%e3%82%a2%e3%83%bc%e3%82%ab%e3%82%a4%e3%83%96%e3%82%92%e3%82%b9%e3%82%af%e3%83%ad%e3%83%bc%e3%83%ab%e3%81%a7%e6%9c%88%e3%81%94%e3%81%a8%e3%81%ab%e8%aa%ad%e3%81%bf%e8%be%bc%e3%81%bf\/","title":{"rendered":"\u6708\u5225\u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u6708\u3054\u3068\u306b\u8aad\u307f\u8fbc\u307f"},"content":{"rendered":"<p>\u6708\u5225\u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u6708\u3054\u3068\u306b\u8aad\u307f\u8fbc\u307f\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u4eca\u6708\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u30da\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3093\u3060\u6642\u8868\u793a\u3057\u3066\u304a\u304d\u3001\u6700\u5f8c\u307e\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\u3068\u3001<br \/>\n\u5148\u6708\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u8aad\u307f\u8fbc\u3080\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u25a0index.php\u306a\u3069<\/p>\n<pre>\r\n<div class=\"grid\">\r\n      <?php\r\n      $year = date('Y');\r\n      $month = date('m');\r\n      $day = date('d');\r\n      $paged = (int) get_query_var('paged');\r\n      $paged = get_query_var('paged') ? get_query_var('paged') : 1;\r\n      $args = array(\r\n\r\n      \t'post_type' => 'post',\r\n        'date_query' => array(\r\n           array(\r\n             'year'  => $year,\r\n             'month' => $month,\r\n             'day'   => $day,\r\n           ),\r\n        ),\r\n\r\n      );\r\n      $the_query = new WP_Query($args);\r\n      if ( $the_query->have_posts() ) :\r\n        while ( $the_query->have_posts() ) : $the_query->the_post();\r\n      ?>\r\n      <article class=\"entry item w2 twitter\">\r\n        <div class=\"item-content\">\r\n          <div class=\"sns-mark\"><\/div>\r\n          <?php echo $icon_thats; ?>\r\n          <figure class=\"entry-thumb\">\r\n            <a href=\"<?php the_permalink(); ?>\"><?php the_post_thumbnail( array(300,200) ); ?><\/a>\r\n          <\/figure>\r\n          <div class=\"entry-body\">\r\n            <time class=\"entry-time\" datetime=\"\"><?php the_time('Y.m.d'); ?><\/time>\r\n            <h3 class=\"entry-title\"><a href=\"#\"><?php the_title(); ?><\/a><\/h3>\r\n          <\/div>\r\n        <\/div>\r\n      <\/article>\r\n      <?php endwhile; endif; ?>\r\n      <!-- \/entry -->\r\n    <\/div>\r\n<\/pre>\n<p>\u25a0js<\/p>\n<pre>\r\nvar href = today = new Date(),\r\n         current_year = today.getFullYear(),\r\n         current_month = today.getMonth() + 1;\r\n\r\n$(function() {\r\n    $(window).scroll(function(ev) {\r\n\r\n        var $window = $(ev.currentTarget),\r\n            height = $window.height(),\r\n            scrollTop = $window.scrollTop(),\r\n            documentHeight = $(document).height();\r\n        if (documentHeight === height + scrollTop) {\r\n          current_month--;\r\n\r\n          if(current_month == 0){\r\n            current_year--;\r\n            current_month = 12;\r\n          }\r\n          console.log(current_year);\r\n          console.log(current_month);\r\n\r\n\r\n          jQuery.ajax({\r\n              type: 'post',\r\n              \r\n              data: {\r\n                'today':today,\r\n                'year':current_year,\r\n                'current_month':current_month\r\n              },\r\n              success: function(data) {\r\n                  data = JSON.parse(data);\r\n                  jQuery(\".section.container\").append(data['html']);\r\n              }\r\n          });\r\n\r\n          return false;\r\n        }\r\n    });\r\n});\r\n<\/pre>\n<p>\u25a0more.php<\/p>\n<pre>\r\n<?php\r\n\r\n    require_once(\"..\/..\/..\/wp-config.php\");\r\n\r\n    \/\/\u6700\u65b0\u6708\u304b\u3089\u4e00\u3064\u524d\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\r\n      $today = $_POST['today'];\r\n      $this_year = $_POST['year'];\r\n      $current_month = $_POST['current_month'];\/\/\u6b21\u547c\u3073\u51fa\u3055\u308c\u308b\u6708\r\n      $first_day = 1;\/\/\u4eca\u73fe\u5728\u306e\u6708\u306e\u521d\u65e5\r\n      $last_day = 31;\/\/\u4eca\u73fe\u5728\u306e\u6708\u306e\u672b\u65e5\r\n\r\n\r\n\r\n\r\n    \/\/\u6700\u65b0\u6708\u524d\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\r\n    $mydata_past = get_posts( array(\r\n        'order' => 'ASC',\r\n        'post_type' => 'post',\r\n        'orderby' => 'date',\r\n        'posts_per_page' => -1,\r\n        'date_query' => array(\r\n            array(\r\n                'after' => array(\r\n                    'year' => $this_year,\r\n                    'month' => $current_month,\r\n                    'day' => $first_day,\r\n                ),\r\n                'before' => array(\r\n                    'year' => $this_year,\r\n                    'month' => $current_month,\r\n                    'day' => $last_day,\r\n                ),\r\n                'inclusive' => true,\r\n            ),\r\n        ),\r\n    ));\r\n\r\n$results = $mydata_past;\r\n    $html = \"\";\r\n\r\n\r\n    foreach ($results as $result) {\r\n      $html .= '<article class=\"grid\">';\r\n        $html .= '<article class=\"entry item\">';\r\n          $html .= '<div class=\"item-content\">';\r\n            $html .= '<div class=\"sns-mark\"><\/div>';\r\n              $html .= '<figure class=\"entry-thumb\">';\r\n                $html .= '<a href=\"'.get_permalink($result->ID).'\">';\r\n                  $html .= get_the_post_thumbnail($result->ID,'full');\r\n                $html .='<\/a>';\r\n              $html .= '<\/figure>';\r\n              $html .= '<div class=\"entry-body\">';\r\n\r\n                $html .= '<div class=\"member_name text_white\">'.get_post_time('m\/d','false',$result->ID).'<\/div>';\r\n                $html .= '<h3 class=\"entry-title\"><a href=\"'.get_permalink($result->ID).'\">';\r\n                $html .=  get_the_title($result->ID);\r\n                $html .='<\/a><\/h3>';\r\n              $html .= '<\/div>';\r\n            $html .= '<\/div>';\r\n          $html .= '<\/div>';\r\n        $html .= '<\/article>';\r\n      $html .= '<\/div>';\r\n    }\r\n\r\n    $returnObj = array();\r\n    $returnObj = array(\r\n        'noDataFlg' => $noDataFlg,\r\n        'html' => $html\r\n    );\r\n    $returnObj = json_encode($returnObj);\r\n\r\n    echo $returnObj;\r\n?>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6708\u5225\u30a2\u30fc\u30ab\u30a4\u30d6\u3092\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u6708\u3054\u3068\u306b\u8aad\u307f\u8fbc\u307f\u3055\u305b\u308b\u65b9\u6cd5\u3067\u3059\u3002 \u4f8b\u3048\u3070\u4eca\u6708\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u30da\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3093\u3060\u6642\u8868\u793a\u3057\u3066\u304a\u304d\u3001\u6700\u5f8c\u307e\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u3059\u308b\u3068\u3001 \u5148\u6708\u306e\u8a18\u4e8b\u4e00\u89a7\u3092\u8aad\u307f\u8fbc\u3080\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u3059\u3002 \u25a0index.php\u306a\u3069<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-21 23:58:04","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1682"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1682"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1682\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}