{"id":3884,"date":"2018-03-07T13:20:22","date_gmt":"2018-03-07T04:20:22","guid":{"rendered":"http:\/\/tcd-manual.net\/?p=3884"},"modified":"2018-03-07T13:20:22","modified_gmt":"2018-03-07T04:20:22","slug":"tdc%e3%83%86%e3%83%bc%e3%83%9eblogpress%e3%80%8c%e9%96%a2%e9%80%a3%e8%a8%98%e4%ba%8b%e3%80%8d%e3%82%92%e9%9d%9e%e8%a1%a8%e7%a4%ba%e3%81%ab%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/tcd-manual.net\/?p=3884","title":{"rendered":"TDC\u30c6\u30fc\u30deBlogPress:\u300c\u95a2\u9023\u8a18\u4e8b\u300d\u3092\u975e\u8868\u793a\u306b\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<h4 class=\"style_headline2\"><span>Q.<\/span>\u300c\u95a2\u9023\u8a18\u4e8b\u300d\u3092\u975e\u8868\u793a\u306b\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308c\u3070\u662f\u975e\u304a\u6559\u3048\u304f\u3060\u3055\u3044\u3002<br \/>\n <\/h4>\n<h4 class=\"style_headline2\"><span>A.<\/span>\u4ee5\u4e0b2\u3064\u306e\u65b9\u6cd5\u3067\u5909\u66f4\u3067\u304d\u307e\u3059<\/h4>\n<p>\u2460CSS\u306b\u304a\u3044\u3066\u8868\u9762\u4e0a\u975e\u8868\u793a\u3068\u3044\u3046\u3053\u3068\u3067\u3057\u305f\u3089<br \/>\n\u5916\u89b3\u3000\uff1e\u3000\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3000\uff1e\u3000\u8ffd\u52a0CSS\u3000\u306b\u4ee5\u4e0bCSS\u8a18\u8ff0\u306e\u8a18\u8f09\u3092\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n#related_post {display:none;}\r\n<\/pre>\n<p>\u2461php\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u3053\u3068\u3067\u5bfe\u5fdc\u3055\u308c\u308b\u5834\u5408\u306f<br \/>\nsingle.php \u306b\u304a\u3044\u3066\u4ee5\u4e0b\u3092\u524a\u9664\u3059\u308b\u3068\u95a2\u9023\u8a18\u4e8b\u304c\u975e\u8868\u793a\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3092\u53d6\u5f97\u306e\u4e0a\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\uff1asingle.php<br \/>\n\u524a\u9664\u3059\u308b\u7b87\u6240\uff1b<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php \/\/ related post\r\n         $odd_or_even = 'odd';\r\n         $categories = get_the_category($post-&gt;ID);\r\n         if ($categories) {\r\n         $category_ids = array();\r\n          foreach($categories as $individual_category) $category_ids&#x5B;] = $individual_category-&gt;term_id;\r\n           $args=array(\r\n                       'category__in' =&gt; $category_ids,\r\n                       'post__not_in' =&gt; array($post-&gt;ID),\r\n                       'showposts'=&gt;6,\r\n                       'orderby' =&gt; 'rand'\r\n                     );\r\n          $my_query = new wp_query($args);\r\n          $i = 1;\r\n          if($my_query-&gt;have_posts()) {\r\n    ?&gt;\r\n    &lt;div id=&quot;related_post&quot;&gt;\r\n     &lt;h3 class=&quot;headline_base2&quot;&gt;&lt;span&gt;&lt;?php _e(&quot;Related post&quot;,&quot;tcd-w&quot;); ?&gt;&lt;\/span&gt;&lt;\/h3&gt;\r\n     &lt;ul class=&quot;clearfix&quot;&gt;\r\n      &lt;?php while ($my_query-&gt;have_posts()) { $my_query-&gt;the_post(); ?&gt;\r\n      &lt;li class=&quot;clearfix &lt;?php echo $odd_or_even; ?&gt;&quot;&gt;\r\n       &lt;a class=&quot;image&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php if ( has_post_thumbnail()) { the_post_thumbnail('small_size'); } else { echo '&lt;img src=&quot;'; bloginfo('template_url'); echo '\/img\/common\/no_image2.gif&quot; alt=&quot;&quot; title=&quot;&quot; \/&gt;'; }; ?&gt;&lt;\/a&gt;\r\n       &lt;div class=&quot;meta&quot;&gt;\r\n        &lt;?php if ($options&#x5B;'show_date']) : ?&gt;&lt;p class=&quot;date&quot;&gt;&lt;?php the_time(__('m\/d. Y', 'tcd-w')) ?&gt;&lt;\/p&gt;&lt;?php endif; ?&gt;\r\n        &lt;h4 class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h4&gt;\r\n       &lt;\/div&gt;\r\n      &lt;\/li&gt;\r\n      &lt;?php $odd_or_even = ('odd'==$odd_or_even) ? 'even' : 'odd'; }; ?&gt;\r\n     &lt;\/ul&gt;\r\n    &lt;\/div&gt;\r\n    &lt;?php }; }; wp_reset_query(); ?&gt;\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Q.\u300c\u95a2\u9023\u8a18\u4e8b\u300d\u3092\u975e\u8868\u793a\u306b\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308c\u3070\u662f\u975e\u304a\u6559\u3048\u304f\u3060\u3055\u3044\u3002 A.\u4ee5\u4e0b2\u3064\u306e\u65b9\u6cd5\u3067\u5909\u66f4\u3067\u304d\u307e\u3059 \u2460CSS\u306b\u304a\u3044\u3066\u8868\u9762\u4e0a\u975e\u8868\u793a\u3068\u3044\u3046\u3053\u3068\u3067\u3057\u305f\u3089 \u5916\u89b3\u3000\uff1e\u3000\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3000\uff1e\u3000\u8ffd\u52a0CSS\u3000\u306b\u4ee5\u4e0bCSS\u8a18\u8ff0\u306e\u8a18\u8f09\u3092\u304a\u8a66\u3057\u304f\u3060 [&hellip;]","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41],"tags":[],"class_list":["post-3884","post","type-post","status-publish","format-standard","hentry","category-tcd010"],"_links":{"self":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/3884","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3884"}],"version-history":[{"count":0,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/3884\/revisions"}],"wp:attachment":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3884"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3884"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3884"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}