{"id":497,"date":"2011-01-17T01:38:40","date_gmt":"2011-01-16T16:38:40","guid":{"rendered":"http:\/\/www.myu-zin.com\/webridge\/?p=497"},"modified":"2011-01-17T01:54:28","modified_gmt":"2011-01-16T16:54:28","slug":"wordpress-%e8%a8%98%e4%ba%8b%e4%b8%80%e8%a6%a7%e3%81%a7%e8%a4%87%e6%95%b0%e3%82%b5%e3%83%a0%e3%83%8d%e3%82%a4%e3%83%ab%e3%82%92%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b-php%e3%82%ab%e3%82%b9%e3%82%bf","status":"publish","type":"post","link":"https:\/\/www.myu-zin.com\/webridge\/archives\/497.html","title":{"rendered":"WordPress \u8a18\u4e8b\u4e00\u89a7\u3067\u8907\u6570\u30b5\u30e0\u30cd\u30a4\u30eb\u3092\u8868\u793a\u3059\u308b-php\u30ab\u30b9\u30bf\u30de\u30a4\u30ba-"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-498\" title=\"php-custom\" src=\"http:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/php-custom.jpg\" alt=\"\" width=\"500\" height=\"200\" srcset=\"https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/php-custom.jpg 500w, https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/php-custom-300x120.jpg 300w, https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/php-custom-400x160.jpg 400w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><br \/>\nWordPress\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u4e00\u89a7\u30da\u30fc\u30b8\u3067\u5404\u8a18\u4e8b\u3092\u4e26\u3079\u308b\u969b\u306b\u3001\u30b5\u30e0\u30cd\u30a4\u30eb\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u306f\u591a\u3005\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002WoedPress\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c3.x\u306b\u306a\u3063\u3066\u304b\u3089\u306f\u6bd4\u8f03\u7684\u7c21\u5358\u306b\u8a2d\u7f6e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u4ee5\u4e0b\u306e\u8a18\u8ff0\u30671\u679a\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u203b\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\uff01\uff09<\/p>\n<h3>\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u753b\u50cf\u3092\u8aad\u307f\u8fbc\u3080<\/h3>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n&lt;?php the_post_thumbnail(array(135,135), array('class' =&gt; 'left')); ?&gt;\r\n<\/pre>\n<p>\u3055\u3089\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001\u8907\u6570\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u3092\u6700\u5927\u679a\u6570\u679a\u6570\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-500\" title=\"guitars-demo\" src=\"http:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/guitars-demo-500x407.jpg\" alt=\"\" width=\"500\" height=\"407\" srcset=\"https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/guitars-demo-500x407.jpg 500w, https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/guitars-demo-300x244.jpg 300w, https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/guitars-demo-400x325.jpg 400w, https:\/\/www.myu-zin.com\/webridge\/wp-content\/uploads\/guitars-demo.jpg 545w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><br \/>\n\u4ee5\u4e0b\u306b\u30bd\u30fc\u30b9\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3054\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n&lt;?php while (have_posts()) : the_post(); ?&gt;\r\n\r\n&lt;div class=&quot;post clearfloat&quot;&gt;\r\n&lt;h3 class=&quot;title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot;&gt;&lt;?php the_title(); ?&gt;&lt;\/a&gt;&lt;\/h3&gt;\r\n&lt;span class=cat_title&gt;&lt;?php the_category(', '); ?&gt; &amp;raquo &lt;\/span&gt;\r\n&lt;div class=&quot;spoiler&quot;&gt;\r\n&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title(); ?&gt;&quot;&gt;\r\n&lt;?php the_post_thumbnail(array(135,135), array('class' =&gt; 'left')); ?&gt;\r\n&lt;\/a&gt;\r\n&lt;?php echo mb_substr(strip_tags($post-&gt; post_content), 0, 100); ?&gt;...&lt;br \/&gt;\r\n\r\n&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; class=&quot;thum-mini&quot;&gt;\r\n&lt;?php\r\n$images = get_children( array(\r\n  'post_parent' =&gt; get_the_ID(),\r\n  'post_type' =&gt; 'attachment',\r\n  'post_mime_type' =&gt; 'image',\r\n  'orderby' =&gt; 'menu_order',\r\n  'order' =&gt; 'ASC',\r\n) );\r\n\r\n$i=0;\r\nforeach ( (array) $images as $attachment_id =&gt; $attachment ) {\r\n  $src = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );\r\n  echo '&lt;img width=&quot;80&quot; height=&quot;80&quot; src=&quot;' . $src&#x5B;0] . '&quot; \/&gt;';\r\nif (3&lt;$i){\r\nbreak;\r\n}\r\n$i++;\r\n}\r\n?&gt;\r\n&lt;\/a&gt;\r\n&lt;br \/&gt;\r\n&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; class=&quot;more-link w-right&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;&lt;span&gt;\u25bc\u753b\u50cf\u3092\u5168\u90e8\u898b\u308b&lt;\/span&gt;&lt;\/a&gt;\r\n\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;?php endwhile; ?&gt;\r\n<\/pre>\n<h3>\u90e8\u5206\u89e3\u8aac<\/h3>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n&lt;?php the_post_thumbnail(array(135,135), array('class' =&gt; 'left')); ?&gt;\r\n<\/pre>\n<p>\u306f\u3001\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u3067\u8a2d\u5b9a\u3057\u305f\u753b\u50cf\u3092\u30b5\u30a4\u30ba\u3001\u30b9\u30bf\u30a4\u30eb\u3092\u6307\u5b9a\u3057\u3066\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n&lt;?php echo mb_substr(strip_tags($post-&gt; post_content), 0, 100); ?&gt;...&lt;br \/&gt;\r\n<\/pre>\n<p>\u306f\u3001\u8a18\u4e8b\u306e\u5185\u5bb9\u3092\u6700\u5927\u6587\u5b57\u6570\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n$images = get_children( array(\r\n  'post_parent' =&gt; get_the_ID(),\r\n  'post_type' =&gt; 'attachment',\r\n  'post_mime_type' =&gt; 'image',\r\n  'orderby' =&gt; 'menu_order',\r\n  'order' =&gt; 'ASC',\r\n) );\r\n<\/pre>\n<p>\u306f\u3001\u3088\u304f\u308f\u304b\u3063\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u8aad\u307f\u8fbc\u3080\u60c5\u5831\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u753b\u50cf\u3067\u3042\u308b\u6761\u4ef6\u3092\u3057\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>wp_get_attachment_image_src()<\/h3>\n<p>\u306f\u3001\u753b\u50cf\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\nforeach ( (array) $images as $attachment_id =&gt; $attachment ) {\r\n  $src = wp_get_attachment_image_src( $attachment_id, 'thumbnail' );\r\n  echo '&lt;img width=&quot;80&quot; height=&quot;80&quot; src=&quot;' . $src&#x5B;0] . '&quot; \/&gt;';\r\n<\/pre>\n<p>\u306f\u3001\u8aad\u307f\u8fbc\u3093\u3060\u753b\u50cf\u3092\u7e70\u308a\u8fd4\u3057\u3066\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u3002\u305f\u3076\u3093\u3002<br \/>\n\u305d\u3057\u3066\u3001foreach\u95a2\u6570\u3060\u3051\u3067\u306f\u7e70\u308a\u8fd4\u3059\u56de\u6570\u3092\u6307\u5b9a\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3057\u305f\u306e\u3067\u3001for\u6587\u3067\u56de\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9; notranslate\" title=\"\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\">\r\n$i=0;\r\n\/* \u5b9f\u884c\u5185\u5bb9\uff08\u4e0a\u8a18\u306eforeach\u95a2\u6570\u304c\u5165\u308a\u307e\u3059\u3002\uff09 *\/\r\nif (3&lt;$i){\r\nbreak;\r\n}\r\n$i++;\r\n}\r\n<\/pre>\n<p>\u306f\u3001\u5909\u6570&#8221;$i&#8221;\u304c&#8221;4&#8243;\u306b\u306a\u3063\u305f\u3089break\uff08\u505c\u6b62\uff09\u3057\u307e\u3059\u3002\u201d0\u201d\u304b\u3089\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u3044\u308b\u306e\u3067\u30015\u56de\u7e70\u308a\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u6700\u59275\u679a\u306e\u30b5\u30e0\u30cd\u30a4\u30eb\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306e\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u4e00\u89a7\u30da\u30fc&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":498,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4,43],"tags":[],"class_list":["post-497","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-43"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/posts\/497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/comments?post=497"}],"version-history":[{"count":6,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/posts\/497\/revisions"}],"predecessor-version":[{"id":503,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/posts\/497\/revisions\/503"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/media\/498"}],"wp:attachment":[{"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/media?parent=497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/categories?post=497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myu-zin.com\/webridge\/wp-json\/wp\/v2\/tags?post=497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}