{"id":2719,"date":"2016-11-15T09:50:57","date_gmt":"2016-11-15T00:50:57","guid":{"rendered":"http:\/\/tcd-manual.net\/?p=2719"},"modified":"2022-11-18T17:48:36","modified_gmt":"2022-11-18T08:48:36","slug":"tcd%e3%83%86%e3%83%bc%e3%83%9ecanvas%ef%bc%9a%e3%80%8e%e5%95%86%e5%93%81%e6%83%85%e5%a0%b1%e3%80%8f%e3%80%8e%e3%81%8a%e7%9f%a5%e3%82%89%e3%81%9b%e3%80%8f%e3%80%8e%e3%83%96%e3%83%ad%e3%82%b0%e3%80%8f","status":"publish","type":"post","link":"https:\/\/tcd-manual.net\/?p=2719","title":{"rendered":"TCD\u30c6\u30fc\u30deCanvas\uff1a\u300e\u5546\u54c1\u60c5\u5831\u300f\u300e\u304a\u77e5\u3089\u305b\u300f\u300e\u30d6\u30ed\u30b0\u300f\u306e3\u70b9\u3092\u975e\u8868\u793a\u306b\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<h4 class=\"style_headline2\"><span>Q.<\/span>\u5546\u54c1\u60c5\u5831\u300f\u300e\u304a\u77e5\u3089\u305b\u300f\u300e\u30d6\u30ed\u30b0\u300f\u306e3\u70b9\u3092\u975e\u8868\u793a\u306b\u3057\u305f\u3044<\/h4>\n<h4 class=\"style_headline2\"><span>A.<\/span>\u4ee5\u4e0b\u306e\u8a72\u5f53\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044<\/h4>\n<p>\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\uff1aindex.php<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n\r\n&lt;?php\r\n     $args = array('post_type' =&gt; 'product', 'numberposts' =&gt; 4);\r\n     $product_post=get_posts($args);\r\n     if ($product_post) {\r\n?&gt;\r\n&lt;div id=&quot;index_product_area&quot;&gt;\r\n &lt;div id=&quot;index_product&quot;&gt;\r\n  &lt;h3 class=&quot;headline&quot;&gt;&lt;?php echo $options&#x5B;'index_headline_product']; ?&gt;&lt;\/h3&gt;\r\n  &lt;ol class=&quot;clearfix&quot;&gt;\r\n   &lt;?php\r\n        $i = 1;\r\n        foreach ($product_post as $post) : setup_postdata ($post);\r\n        $custom_fields = get_post_custom($post-&gt;ID);\r\n        $value1 = get_post_meta($post-&gt;ID, 'product_image', true);\r\n        $image1 = wp_get_attachment_image_src($value1, 'size4');\r\n        if(!empty($custom_fields&#x5B;'product_description']&#x5B;0])) {\r\n          $base_desc = $custom_fields&#x5B;'product_description']&#x5B;0];\r\n          $trim_desc = mb_substr($base_desc, 0,  50,&quot;utf-8&quot;);\r\n        };\r\n   ?&gt;\r\n   &lt;li class=&quot;num&lt;?php echo $i; ?&gt;&quot;&gt;\r\n    &lt;a class=&quot;image&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php if\r\n(!empty($custom_fields&#x5B;'product_image']&#x5B;0])) { ?&gt;&lt;img src=&quot;&lt;?php echo\r\n$image1&#x5B;0]; ?&gt;&quot; alt=&quot;&quot; title=&quot;&quot; \/&gt;&lt;?php } else { echo '&lt;img src=&quot;';\r\nbloginfo('template_url'); echo '\/img\/common\/no_image1.gif&quot; alt=&quot;&quot;\r\ntitle=&quot;&quot; \/&gt;'; }; ?&gt;&lt;\/a&gt;\r\n    &lt;h4 class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php\r\nthe_title(); ?&gt;&lt;\/a&gt;&lt;\/h4&gt;\r\n    &lt;?php if (!empty($custom_fields&#x5B;'product_description']&#x5B;0])) { ?&gt;&lt;p\r\nclass=&quot;desc&quot;&gt;&lt;?php echo $trim_desc ; ?&gt;&lt;\/p&gt;&lt;?php }; ?&gt;\r\n   &lt;\/li&gt;\r\n   &lt;?php $i++; endforeach; wp_reset_query(); ?&gt;\r\n  &lt;\/ol&gt;\r\n &lt;\/div&gt;\r\n&lt;\/div&gt;&lt;!-- END #index_product_area --&gt;\r\n&lt;?php }; ?&gt;\r\n\r\n\r\n&lt;div class=&quot;content&quot;&gt;\r\n &lt;div class=&quot;content_inner clearfix&quot;&gt;\r\n\r\n  &lt;div id=&quot;index_news&quot;&gt;\r\n   &lt;h3 class=&quot;headline&quot;&gt;&lt;?php echo $options&#x5B;'index_headline_news']; ?&gt;&lt;\/h3&gt;\r\n   &lt;ol class=&quot;clearfix&quot;&gt;\r\n    &lt;?php\r\n         $args = array('post_type' =&gt; 'news', 'numberposts' =&gt; 3);\r\n         $news_post=get_posts($args);\r\n         if ($news_post) :\r\n         foreach ($news_post as $post) : setup_postdata ($post);\r\n    ?&gt;\r\n    &lt;li class=&quot;clearfix&quot;&gt;\r\n     &lt;p class=&quot;news_date&quot;&gt;&lt;span class=&quot;date&quot;&gt;&lt;?php the_time('n.j');\r\n?&gt;&lt;\/span&gt;&lt;span class=&quot;month&quot;&gt;&lt;?php the_time('Y'); ?&gt;&lt;\/span&gt;&lt;\/p&gt;\r\n     &lt;h4 class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php\r\ntrim_title(25); ?&gt;&lt;\/a&gt;&lt;\/h4&gt;\r\n     &lt;p class=&quot;desc&quot;&gt;&lt;?php if (has_excerpt()) { the_excerpt(); } else\r\n{ new_excerpt(85);}; ?&gt;&lt;\/p&gt;\r\n    &lt;\/li&gt;\r\n    &lt;?php endforeach; else: ?&gt;\r\n    &lt;li class=&quot;no_post&quot;&gt;&lt;p&gt;&lt;?php _e(&quot;There is no registered\r\nnews.&quot;,&quot;tcd-w&quot;); ?&gt;&lt;\/p&gt;&lt;\/li&gt;\r\n    &lt;?php endif; ?&gt;\r\n   &lt;\/ol&gt;\r\n   &lt;div class=&quot;index_archive_link&quot;&gt;&lt;a href=&quot;&lt;?php echo\r\nget_post_type_archive_link('news'); ?&gt;&quot;&gt;&lt;?php _e(&quot;Older\r\nNews&quot;,&quot;tcd-w&quot;); ?&gt;&lt;\/a&gt;&lt;\/div&gt;\r\n  &lt;\/div&gt;&lt;!-- END #index_news --&gt;\r\n\r\n  &lt;div id=&quot;index_blog&quot;&gt;\r\n   &lt;h3 class=&quot;headline&quot;&gt;&lt;?php echo $options&#x5B;'index_headline_blog']; ?&gt;&lt;\/h3&gt;\r\n   &lt;ol class=&quot;clearfix&quot;&gt;\r\n    &lt;?php\r\n         $args = array('post_type' =&gt; 'post', 'numberposts' =&gt; 3);\r\n         $index_recent_post=get_posts($args);\r\n         if ($index_recent_post) :\r\n         foreach ($index_recent_post as $post) : setup_postdata ($post);\r\n    ?&gt;\r\n    &lt;li class=&quot;clearfix&lt;?php if (has_post_thumbnail()) { echo '\r\nhas_thumbnail'; }; ?&gt;&quot;&gt;\r\n     &lt;?php if ($options&#x5B;'show_thumbnail'] and has_post_thumbnail()) {\r\n?&gt;&lt;a class=&quot;image&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php echo\r\nthe_post_thumbnail('size1'); ?&gt;&lt;\/a&gt;&lt;?php }; ?&gt;\r\n     &lt;div class=&quot;info&quot;&gt;\r\n      &lt;?php if ($options&#x5B;'show_date']||$options&#x5B;'show_category']) { ?&gt;\r\n      &lt;ul class=&quot;meta clearfix&quot;&gt;\r\n       &lt;?php if ($options&#x5B;'show_date']) { ?&gt;&lt;li\r\nclass=&quot;post_date&quot;&gt;&lt;?php the_time('Y.m.d'); ?&gt;&lt;\/li&gt;&lt;?php }; ?&gt;\r\n       &lt;?php if ($options&#x5B;'show_category']) { ?&gt;&lt;li\r\nclass=&quot;post_category&quot;&gt;&lt;?php the_category(', '); ?&gt;&lt;\/li&gt;&lt;?php }; ?&gt;\r\n      &lt;\/ul&gt;\r\n      &lt;?php }; ?&gt;\r\n      &lt;h4 class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php\r\nthe_title(); ?&gt;&lt;\/a&gt;&lt;\/h4&gt;\r\n     &lt;\/div&gt;\r\n    &lt;\/li&gt;\r\n    &lt;?php endforeach; else: ?&gt;\r\n    &lt;li class=&quot;no_post&quot;&gt;&lt;p&gt;&lt;?php _e(&quot;There is no registered\r\npost.&quot;,&quot;tcd-w&quot;); ?&gt;&lt;\/p&gt;&lt;\/li&gt;\r\n    &lt;?php endif; ?&gt;\r\n   &lt;\/ol&gt;\r\n   &lt;div class=&quot;index_archive_link&quot;&gt;&lt;?php next_posts_link(__('Older\r\nEntries', 'tcd-w')) ?&gt;&lt;\/div&gt;\r\n  &lt;\/div&gt;&lt;!-- END #index_blog --&gt;\r\n\r\n\r\n  &lt;ul id=&quot;index_banner&quot; class=&quot;clearfix&quot;&gt;\r\n   &lt;?php for($i = 1; $i &lt;= 3; $i++): ?&gt;\r\n   &lt;?php if (!empty($options&#x5B;'index_banner_image'.$i])) { ?&gt;\r\n     &lt;li class=&quot;num&lt;?php echo $i; ?&gt;&quot;&gt;&lt;a class=&quot;target_blank&quot;\r\nhref=&quot;&lt;?php echo $options&#x5B;'index_banner_url'.$i]; ?&gt;&quot;&gt;&lt;img src=&quot;&lt;?php\r\nesc_attr_e( $options&#x5B;'index_banner_image'.$i] ); ?&gt;&quot; alt=&quot;&quot;\r\n\/&gt;&lt;\/a&gt;&lt;\/li&gt;\r\n   &lt;?php }; ?&gt;\r\n   &lt;?php endfor; ?&gt;\r\n  &lt;\/ul&gt;\r\n\r\n\r\n &lt;\/div&gt;&lt;!-- END .content_inner --&gt;\r\n&lt;\/div&gt;&lt;!-- END .content --&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"Q.\u5546\u54c1\u60c5\u5831\u300f\u300e\u304a\u77e5\u3089\u305b\u300f\u300e\u30d6\u30ed\u30b0\u300f\u306e3\u70b9\u3092\u975e\u8868\u793a\u306b\u3057\u305f\u3044 A.\u4ee5\u4e0b\u306e\u8a72\u5f53\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044 \u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\uff1aindex.php &lt;?php $args = array('post_type' =&gt;  [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[66],"class_list":["post-2719","post","type-post","status-publish","format-standard","hentry","category-tcd017","tag-top-page"],"_links":{"self":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/2719","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2719"}],"version-history":[{"count":0,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/2719\/revisions"}],"wp:attachment":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}