{"id":220404,"date":"2017-08-23T17:51:09","date_gmt":"2017-08-23T08:51:09","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/topic\/%e4%b8%8d%e5%8b%95%e7%94%a3%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e7%89%a9%e4%bb%b6%e7%94%bb%e5%83%8f%e3%82%92%e5%9b%ba%e5%ae%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ab%e8%a1%a8%e7%a4%ba\/"},"modified":"2017-08-23T17:51:09","modified_gmt":"2017-08-23T08:51:09","slug":"%e4%b8%8d%e5%8b%95%e7%94%a3%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e7%89%a9%e4%bb%b6%e7%94%bb%e5%83%8f%e3%82%92%e5%9b%ba%e5%ae%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ab%e8%a1%a8%e7%a4%ba","status":"publish","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/%e4%b8%8d%e5%8b%95%e7%94%a3%e3%83%97%e3%83%a9%e3%82%b0%e3%82%a4%e3%83%b3%e3%81%ae%e7%89%a9%e4%bb%b6%e7%94%bb%e5%83%8f%e3%82%92%e5%9b%ba%e5%ae%9a%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ab%e8%a1%a8%e7%a4%ba\/","title":{"rendered":"\u4e0d\u52d5\u7523\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u7269\u4ef6\u753b\u50cf\u3092\u56fa\u5b9a\u30da\u30fc\u30b8\u306b\u8868\u793a\u3055\u305b\u305f\u3044"},"content":{"rendered":"<p>\u4e0d\u52d5\u7523\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30a4\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\npage-fudosan.php\u3068\u3044\u3046\u56fa\u5b9a\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u6bce\u306b\u65b0\u7740\u7269\u4ef6\u30923\u4ef6\u305a\u3064\u8868\u793a\u3055\u305b\u308b\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u304c\u306a\u3051\u308c\u3070\u300c\u7269\u4ef6\u753b\u50cf\u300d\u306e1\u679a\u76ee\uff08fudoimg1\uff09\u3092\u8868\u793a\u3055\u305b\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u753b\u50cf\u306e\u53d6\u5f97\u304c\u4e0a\u624b\u304f\u3044\u304b\u305a\u306b\u56f0\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>&lt;?php\n\/**** functions ****\/ \/\/\u4fa1\u683c\u8868\u793a\u306e\u305f\u3081\u306b\u30b7\u30f3\u30b0\u30eb\u6295\u7a3f\u6a5f\u80fd\u8aad\u307f\u8fbc\u307f\nrequire_once WP_PLUGIN_DIR . &#039;\/fudou\/inc\/inc-single-fudo.php&#039;;\n\nglobal $post;\n\n\/\/\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u30bf\u30fc\u30e0\u304c\u3042\u308b\u9650\u308a\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u5909\u66f4\n$terms = get_terms(&#039;bukken&#039;, &#039;hide_empty=0&#039;);\n$term_count = 0;\nif ( !empty( $terms ) ){\n\tforeach ( $terms as $term ) {\n\t\t\/\/echo &#039;&gt;&#039;.$term-&gt;name.&#039;&#039;;\n\t\t\/\/var_dump($term);\n\t\t\/\/echo &#039;&gt;&#039;.$term-&gt;slug.&#039;&#039;;\n\t\t$term_count++;\t\t\n\n\t\t$args = array(\n\t\t\t&#039;post_type&#039; =&gt;&#039;fudo&#039;,\n\t\t\t&#039;post_status&#039; =&gt;&#039;publish&#039;,\n\t\t\t&#039;orderby&#039; =&gt; &#039;date&#039;,\n\t\t\t&#039;order&#039; =&gt; &#039;desc&#039;,\n\t\t\t&#039;posts_per_page&#039; =&gt; &#039;3&#039;,\n\t\t\t&#039;tax_query&#039;      =&gt; array(\n\t\t\t\tarray(\n\t\t\t\t\t&#039;taxonomy&#039; =&gt; &#039;bukken&#039;,  \/\/ \u30ab\u30b9\u30bf\u30e0\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u540d\n\t\t\t\t\t&#039;field&#039;    =&gt; &#039;slug&#039;,  \/\/ \u30bf\u30fc\u30e0\u540d\u3092 term_id,slug,name \u306e\u3069\u308c\u3067\u6307\u5b9a\u3059\u308b\u304b\n\t\t\t\t\t&#039;terms&#039;    =&gt; $term-&gt;slug \/\/ \u30bf\u30af\u30bd\u30ce\u30df\u30fc\u306b\u5c5e\u3059\u308b\u30bf\u30fc\u30e0\u540d\n\t\t\t\t)\n\t\t\t)          \n\t\t);\n\t\t$posts = get_posts( $args );\n\t\/\/danmp\n\t\/\/var_dump($posts);\n\n\tif($posts):\t\t\t  \n\t?&gt;\n\t&lt;!-- \u25bcBEGIN fudo --&gt;\n\t&lt;section class=&quot;section&quot; id=&quot;fudo&lt;?php echo ucfirst($term-&gt;slug); ?&gt;&quot;&gt;\n\t&lt;div class=&quot;inner&quot;&gt;     \n\n\t&lt;!-- ============================== bukkenList ============================== --&gt;\n\t&lt;div class=&quot;bukkenList cf&quot;&gt;\n\t\t&lt;?php foreach($posts as $post): setup_postdata($post); ?&gt;\t\t\t \n\t\t&lt;dl class=&quot;bukkenListItem&quot;&gt;\n\t\t\t&lt;dt class=&quot;entryEyecatch&quot;&gt;\n      &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot;&gt;\n      &lt;?php if(has_post_thumbnail()): ?&gt;\n        &lt;?php the_post_thumbnail(&#039;medium&#039;, array(&#039;class&#039; =&gt; &#039;attachment-medium archive-eyecatch&#039;)); ?&gt;\n      &lt;?php else: ?&gt;\n        &lt;!--\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u306e\u8a2d\u5b9a\u304c\u306a\u3051\u308c\u3070\u4e0d\u52d5\u7523\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u753b\u50cf\uff11\u3092\u8868\u793a\u3055\u305b\u305f\u3044 --&gt;\n        &lt;?php $fudoimg_data = get_post_meta(get_the_ID(), &#039;fudoimg1&#039;, true); ?&gt;\n        &lt;img src=&quot;&lt;?php echo &#039;wp-content\/uploads\/&#039;.$fudoimg_data; ?&gt;&quot; alt=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; width=&quot;&quot; height=&quot;&quot;&gt;\n      &lt;?php endif; ?&gt;\n    \t&lt;\/a&gt;\n\t\t\t&lt;\/dt&gt;\n\t\t\t&lt;dd class=&quot;entryTitle&quot;&gt;\n\t\t\t\t\uff5e\uff5e\u7701\u7565\uff5e\uff5e\n\t\t\t&lt;dd&gt;\n\t\t&lt;\/dl&gt;&lt;?php \/\/\u65b0\u7740\u306e\u307f\u8868\u793a\u3059\u308b\u5834\u5408\u306e\u307f\u4f7f\u7528 } ?&gt;&lt;!-- \/#post-## --&gt;    \n\t\t&lt;?php endforeach; wp_reset_postdata(); ?&gt;\n\t\t&lt;\/div&gt;\n\t\t&lt;!-- ============================== \/bukkenList ============================== --&gt;\n\t&lt;\/div&gt;\n\t&lt;\/section&gt;\n\t&lt;!-- \u25b2END fudo --&gt;\n\t&lt;?php endif; ?&gt;\n&lt;?php\n\t}\n}\n\/\/var_dump($terms[0]);\n?&gt;<\/code><\/pre>\n<p>$fudoimg_data\u3060\u3051\u3067\u306f\u753b\u50cf\u540d\u3057\u304b\u53d6\u5f97\u3067\u304d\u305a\u3001\u5e74\u6708\u30d5\u30a9\u30eb\u30c0\u306e\u53d6\u5f97\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<br \/>\nwp_get_attachment_image_src\u3084wp_get_attachment_url\u3067\u3082\u8a66\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u753b\u50cfURL\u81ea\u4f53\u53d6\u5f97\u3059\u308b\u3053\u3068\u3082\u51fa\u6765\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u753b\u50cf\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30d5\u30a9\u30eb\u30c0\u306f\u5e74\u6708\u5225\u306b\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u65e2\u306b\u30d6\u30ed\u30b0\u3067\u5927\u91cf\u306e\u753b\u50cf\u304c\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30d5\u30a9\u30eb\u30c0\u3092\u5909\u3048\u308b\u308f\u3051\u306b\u306f\u3044\u304d\u307e\u305b\u3093\u3002<\/p>\n<pre><code>&lt;?php\n\t$upload_dir = wp_upload_dir();\n\t$upload_url = ( $upload_dir[&#039;url&#039;] );\n?&gt;\n&lt;?php $fudoimg_data = get_post_meta(get_the_ID(), &#039;fudoimg1&#039;, true); ?&gt;\n&lt;img src=&quot;&lt;?php echo $upload_url. &#039;\/&#039; .$fudoimg_data; ?&gt;&quot; alt=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; width=&quot;&quot; height=&quot;&quot;&gt;<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3082\u8a66\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001fudoimg1\u306e$upload_dir[&#8216;url&#8217;]\u3067\u306f\u306a\u304f\u3001\u4f55\u304b\u5225\u306e$upload_dir[&#8216;url&#8217;]\u3092\u53d6\u5f97\u3057\u3066\u308b\u3088\u3046\u3067\u9055\u3046\u5e74\u6708\u30d5\u30a9\u30eb\u30c0\u306eURL\u304c\u8868\u793a\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3069\u3046\u3057\u305f\u3089fudoimg1\u306e\u753b\u50cfURL\u3092\u53d6\u5f97\u3067\u304d\u308b\u304b\u3001\u3069\u306a\u305f\u304b\u30a2\u30c9\u30d0\u30a4\u30b9\u3044\u305f\u3060\u3051\u307e\u305b\u3093\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n","protected":false},"template":"","class_list":["post-220404","topic","type-topic","status-publish","hentry","topic-tag-url","topic-tag-17504"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/220404","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\/220404\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=220404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}