{"id":247,"date":"2018-02-06T18:04:36","date_gmt":"2018-02-06T09:04:36","guid":{"rendered":"http:\/\/genicca.wp.xdomain.jp\/?p=247"},"modified":"2025-02-13T11:43:09","modified_gmt":"2025-02-13T02:43:09","slug":"%e2%97%8b%e5%b9%b4%e5%89%8d%e3%82%88%e3%82%8a%e5%8f%a4%e3%81%84%e8%a8%98%e4%ba%8b%e3%81%af%e5%8f%96%e5%be%97%e3%81%97%e3%81%aa%e3%81%84","status":"publish","type":"post","link":"https:\/\/genicca.cloudfree.jp\/?p=247","title":{"rendered":"\u25cb\u5e74\u524d\u3088\u308a\u53e4\u3044\u8a18\u4e8b\u306f\u53d6\u5f97\u3057\u306a\u3044"},"content":{"rendered":"<p>\u30bf\u30a4\u30c8\u30eb\u306e\u3068\u304a\u308a\u3067\u3059\u3002<br \/>\n\u3042\u307e\u308a\u9700\u8981\u304c\u306a\u3044\u306e\u304b\u8abf\u3079\u3066\u3082\u30d2\u30c3\u30c8\u3057\u306a\u304f\u3066\u82e6\u6226\u3057\u307e\u3057\u305f\u304c\u306a\u3093\u3068\u304b\u3002<\/p>\n<p>strtotime( &#8216;-2 years&#8217; )\u3000\u306e\u90e8\u5206\u3092-1days\u3068\u304b-3months\u3068\u304b\u8272\u3005\u5909\u66f4\u3059\u308b\u3068\u3088\u3057\u3067\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;?php\r\nadd_filter( 'posts_where', 'filter_where' );\r\nfunction filter_where( $where = '' ) {\r\n$where .= \" AND DATE(post_date) &gt;= '\" . date( 'Y-m-d', strtotime( '-2 years' ) ) . \"'\";\r\nreturn $where;\r\n}\r\nglobal $query_string;\r\nquery_posts( $query_string );\r\n?&gt;<\/code><\/pre>\n<\/div>\n<p>\u5b9f\u969b\u306e\u4f7f\u3044\u65b9\u3068\u3057\u3066\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>&lt;div class=\"txt\"&gt;\r\n&lt;div class=\"home-c_t\"&gt;\r\n&lt;ul class=\"home-tp\"&gt;\r\n&lt;?php\r\nadd_filter( 'posts_where', 'filter_where' );\r\nfunction filter_where( $where = '' ) {\r\n$where .= \" AND DATE(post_date) &gt;= '\" . date( 'Y-m-d', strtotime( '-2 years' ) ) . \"'\";\r\nreturn $where;\r\n}\r\nglobal $query_string;\r\nquery_posts( $query_string );\r\n?&gt;\r\n&lt;?php query_posts(\"showposts=-1&amp;cat=3\");\r\nwhile (have_posts()) : the_post();\r\n?&gt;\r\n&lt;?php\r\n$cat = get_the_category();\r\n$catslug = $cat[0]-&gt;slug; \/\/\u30b9\u30e9\u30c3\u30b0\u540d\r\n?&gt;\r\n\r\n&lt;?php if(empty($post-&gt;post_content)) : ?&gt;\r\n&lt;li class=\"newscontent\"&gt;\r\n&lt;div class=\"&lt;?php echo $catslug; ?&gt; date\"&gt;&lt;?php the_time('Y.m.d');?&gt;&lt;\/div&gt;\r\n&lt;div id=\"post-&lt;?php the_ID(); ?&gt;\"&gt;&lt;?php the_title(); ?&gt;&lt;\/div&gt;\r\n&lt;\/li&gt;\r\n&lt;?php else : ?&gt;\r\n&lt;li class=\"newscontent\"&gt;\r\n&lt;div class=\"&lt;?php echo $catslug; ?&gt; date\"&gt;&lt;?php the_time('Y.m.d');?&gt;&lt;\/div&gt;\r\n&lt;div id=\"post-&lt;?php the_ID(); ?&gt;\"&gt;&lt;a href=\"&lt;?php the_permalink(); ?&gt;\" class=\"home-a_link\"&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/div&gt;\r\n&lt;\/li&gt;\r\n&lt;?php endif; ?&gt;\r\n&lt;?php endwhile; ?&gt;\r\n&lt;?php wp_reset_query(); ?&gt;\r\n&lt;\/ul&gt;\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<p>\u53c2\u8003\u30b5\u30a4\u30c8<\/p>\n<blockquote><p><a href=\"http:\/\/webcake.no003.info\/webdesign\/wp-queryposts-datesearch.html\" rel=\"noopener\" target=\"_blank\">http:\/\/webcake.no003.info\/webdesign\/wp-queryposts-datesearch.html<\/a><\/p><\/blockquote>\n<p>\u3059\u3054\u304f\u305f\u3081\u306b\u306a\u308a\u305d\u3046\u3060\u3063\u305f\u304b\u3089\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3082\u3068\u3063\u3068\u3044\u305f\u3002\uff08\u3088\u304f\u30da\u30fc\u30b8\u304c\u6d88\u3048\u308b\u304b\u3089<br \/>\n<a href=\"http:\/\/genicca.wp.xdomain.jp\/wp-content\/uploads\/2018\/02\/sc0206.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/genicca.wp.xdomain.jp\/wp-content\/uploads\/2018\/02\/sc0206-96x300.png\" alt=\"\" width=\"96\" height=\"300\" class=\"alignnone size-medium wp-image-250\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30bf\u30a4\u30c8\u30eb\u306e\u3068\u304a\u308a\u3067\u3059\u3002 \u3042\u307e\u308a\u9700\u8981\u304c\u306a\u3044\u306e\u304b\u8abf\u3079\u3066\u3082\u30d2\u30c3\u30c8\u3057\u306a\u304f\u3066\u82e6\u6226\u3057\u307e\u3057\u305f\u304c\u306a\u3093\u3068\u304b\u3002 strtotime( &#8216;-2 years&#8217; )\u3000\u306e\u90e8\u5206\u3092-1days\u3068\u304b-3months\u3068\u304b\u8272\u3005\u5909\u66f4\u3059\u308b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-247","post","type-post","status-publish","format-standard","hentry","category-php","category-wp"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=247"}],"version-history":[{"count":5,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions"}],"predecessor-version":[{"id":572,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/247\/revisions\/572"}],"wp:attachment":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}