{"id":161167,"date":"2013-05-21T08:22:37","date_gmt":"2013-05-20T23:22:37","guid":{"rendered":""},"modified":"2016-07-30T20:23:41","modified_gmt":"2016-07-30T20:23:41","slug":"%e6%9c%aa%e6%9d%a5%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e8%a1%a8%e7%a4%ba%e3%80%81%e6%9c%aa%e6%9d%a5%e3%81%ae%e6%8a%95%e7%a8%bf%e3%81%8c%e7%84%a1%e3%81%84%e5%a0%b4%e5%90%88%e3%81%af%e3%80%81%e7%89%b9","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/%e6%9c%aa%e6%9d%a5%e3%81%ae%e6%8a%95%e7%a8%bf%e3%82%92%e8%a1%a8%e7%a4%ba%e3%80%81%e6%9c%aa%e6%9d%a5%e3%81%ae%e6%8a%95%e7%a8%bf%e3%81%8c%e7%84%a1%e3%81%84%e5%a0%b4%e5%90%88%e3%81%af%e3%80%81%e7%89%b9\/","title":{"rendered":"\u672a\u6765\u306e\u6295\u7a3f\u3092\u8868\u793a\u3001\u672a\u6765\u306e\u6295\u7a3f\u304c\u7121\u3044\u5834\u5408\u306f\u3001\u7279\u5b9a\u306e\u8a18\u4e8b\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f<\/p>\n<p>\u30b5\u30a4\u30c8\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u8a18\u4e8b\u306e\u4e00\u89a7\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<br \/>\n\u5b9f\u88c5\u3057\u305f\u3044\u5206\u5c90\u306f\u3001<\/p>\n<p>\uff11\u3001\u8a18\u4e8b\u30ab\u30c6\u30b4\u30ea\u30fcID:1\u306b\u6295\u7a3f\u3055\u308c\u305f\u672a\u6765\u306e\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3001\u65e5\u6642\u3001\u672c\u6587\u629c\u7c8b(\u30e9\u30a4\u30d6\u306e\u60c5\u5831\u306a\u3069)\u3092\u8868\u793a\u3055\u305b\u308b\u3002<br \/>\n\uff08\u4e00\u756a\u8fd1\u3044\u65e5\u7a0b\u306e1\u4ef6\u306e\u307f\uff09<\/p>\n<p>\uff12\u3001\u8a18\u4e8b\u30ab\u30c6\u30b4\u30ea\u30fcID:1\u306e\u672a\u6765\u306e\u8a18\u4e8b\u304c\u7121\u3044\u5834\u5408\u306f\u3001\u8a18\u4e8bp=10\u306e\u30bf\u30a4\u30c8\u30eb\u3001\u65e5\u6642\u3001\u672c\u6587\u629c\u7c8b\u3092\u8868\u793a\u3055\u305b\u308b\u3002<\/p>\n<p>\u4ee5\u4e0a\u306e\u5206\u5c90\u3092\u6b63\u5e38\u306b\u6a5f\u80fd\u3055\u305b\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u4e0a\u624b\u304f\u3044\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u73fe\u5728\uff11\u306e\u90e8\u5206\u307e\u3067\u306f\u6b63\u5e38\u306b\u6a5f\u80fd\u3059\u308b\u30da\u30fc\u30b8\u306f\u4f5c\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>&lt;?php function filter_where($where = &#8221;) {<br \/>\n$where .= &#8221; AND post_date &lt; &#8216;&#8221; . date(&#8216;Y-m-d&#8217;, strtotime(&#8216;1 days&#8217;)) . &#8220;&#8216;&#8221;;<br \/>\nreturn $where;<br \/>\n}<br \/>\nadd_filter(&#8216;posts_where&#8217;, &#8216;filter_where&#8217;);?&gt;<br \/>\n&lt;?php query_posts(&#8216;&amp;order=ASC&amp;cat=1&amp;showposts=1&#8217;);?&gt;<br \/>\n&lt;?php if(have_posts()):while(have_posts()):the_post();?&gt;&#8221;&gt;<br \/>\n&lt;div class=&#8221;news_post&#8221;&gt;<br \/>\n&lt;div class=&#8221;post_title&#8221;&gt;<br \/>\n&lt;span class=&#8221;date&#8221;&gt;&lt;?php the_time(&#8216;m.d.Y&#8217;);?&gt;&lt;\/span&gt;<br \/>\n&lt;p&gt;&lt;?php if(mb_strlen($post-&gt;post_title)&gt;20)<br \/>\n{ $title= mb_substr($post-&gt;post_title,0,20) ; echo $title. &#8220;&#8230;&#8221;;<br \/>\n} else {echo $post-&gt;post_title;}?&gt;&lt;\/p&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;?php  $postImage = getPostImage($post);<br \/>\nif($postImage == null){<br \/>\necho &#8216;&lt;div class=&#8221;img_flame&#8221;&gt;&lt;div class=&#8221;first_img&#8221;&gt;&lt;img class=&#8221;first_img&#8221; width=&#8221;100%&#8221; src=&#8221;xxx.jpg&#8221; \/&gt;&lt;\/div&gt;&lt;\/div&gt;&#8217;;<br \/>\n}else{<br \/>\necho &#8216;&lt;div class=&#8221;img_flame&#8221;&gt;&lt;div class=&#8221;first_img&#8221;&gt;&lt;img class=&#8221;first_img&#8221; alt=&#8221;&#8216;.$postImage[&#8220;alt&#8221;].'&#8221;width=&#8221;100%&#8221; src=&#8221;&#8216;.$postImage[&#8220;url&#8221;].'&#8221; \/&gt;&lt;\/div&gt;&lt;\/div&gt;&#8217;;<br \/>\n} ?&gt;<br \/>\n&lt;div class=&#8221;post_content&#8221;&gt;<br \/>\n&lt;p&gt;&lt;?php echo mb_substr(strip_tags($post-&gt; post_content), 0, 50); ?&gt;&lt;\/p&gt;<br \/>\n&lt;p class=&#8221;more-link&#8221;&gt;&gt;&gt;READ MORE&lt;\/p &gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;?php endwhile;?&gt;<br \/>\n&lt;?php endif;?&gt;<br \/>\n&lt;?php wp_reset_query();?&gt;<br \/>\n&lt;?php remove_filter(&#8216;posts_where&#8217;, &#8216;filter_where&#8217;);?&gt;<\/p>\n<p>\u3053\u308c\u306b\u3001\u3069\u306e\u3088\u3046\u306a\u6761\u4ef6\u5206\u5c90\u3092\u3064\u3051\u308c\u3070\u3001\u826f\u3044\u306e\u304b\u308f\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u304a\u5206\u304b\u308a\u306b\u306a\u308b\u65b9\u304c\u3044\u3089\u3063\u3057\u3083\u3044\u307e\u3057\u305f\u3089\u3001\u6559\u3048\u3066\u9802\u304d\u305f\u3044\u3068\u601d\u3063\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"template":"","class_list":["post-161167","topic","type-topic","status-closed","hentry","topic-tag-add-filter","topic-tag-if","topic-tag-wp_query"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/161167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/161167\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=161167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}