{"id":1007,"date":"2017-10-26T17:23:27","date_gmt":"2017-10-26T08:23:27","guid":{"rendered":"http:\/\/4koma-web.com\/coding\/?p=1007"},"modified":"2017-10-26T17:26:59","modified_gmt":"2017-10-26T08:26:59","slug":"wordpress-%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%92%e3%81%a4%e3%81%91%e3%82%8b","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/wordpress-%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%92%e3%81%a4%e3%81%91%e3%82%8b\/","title":{"rendered":"WordPress \u30ab\u30c6\u30b4\u30ea\u306b\u753b\u50cf\u3092\u3064\u3051\u308b"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1010\" src=\"http:\/\/4koma-web.com\/coding\/wp-content\/uploads\/2017\/10\/0c4c6407ed442c0091a01243b9eba169_s.jpg\" alt=\"\" width=\"640\" height=\"480\" \/>WordPress\u306e\u30ab\u30c6\u30b4\u30ea\u306b\u753b\u50cf\u3092\u767b\u9332\u3057\u3066\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u306b\u30ab\u30c6\u30b4\u30ea\u30fc\u4e00\u89a7\u3068\u3057\u3066\u8868\u793a\u3057\u305f\u3044\u3068\u304d\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u6642\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u30ab\u30c6\u30b4\u30ea\u306b\u753b\u50cf\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n[Advanced Custom Fields]\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066<br \/>\n1.\u300c\u30d5\u30a3\u30fc\u30eb\u30c9\u30b0\u30eb\u30fc\u30d7\u300d\u3068\u3044\u3046\u8a2d\u5b9a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u300c\u65b0\u898f\u8ffd\u52a0\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n2.\u300c\u30d5\u30a3\u30fc\u30eb\u30c9\u30b0\u30eb\u30fc\u30d7\u300d\u306b\u30bf\u30a4\u30c8\u30eb\u3092\u5165\u529b\u300c+\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u300d\u3092\u30af\u30ea\u30c3\u30af\u3002<br \/>\n3.\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u8a2d\u5b9a\u9805\u76ee\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u4f4d\u7f6e &gt; \u30eb\u30fc\u30eb\u306e\u8a2d\u5b9a\u3092Taxonomy Term \u7b49\u3057\u3044\u3000\u30ab\u30c6\u30b4\u30ea\u30fc\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30ab\u30c6\u30b4\u30ea\u30fc\u4e00\u89a7\u3068\u3057\u3066\u753b\u50cf\u3092\u8868\u793a<\/h3>\n<div class=\"line number1 index0 alt2\"><code class=\"php plain\">&lt;?php<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"php variable\">$categories<\/code> <code class=\"php plain\">= get_categories();<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"php comments\">\/\/$categories = get_categories('parent=0'); \u89aa\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u307f<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"php keyword\">foreach<\/code><code class=\"php plain\">(<\/code><code class=\"php variable\">$categories<\/code> <code class=\"php keyword\">as<\/code> <code class=\"php variable\">$category<\/code><code class=\"php plain\">) :<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"php variable\">$cat_id<\/code> <code class=\"php plain\">= <\/code><code class=\"php variable\">$category<\/code><code class=\"php plain\">-&gt;cat_ID;<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"php variable\">$post_id<\/code> <code class=\"php plain\">= <\/code><code class=\"php string\">'category_'<\/code><code class=\"php plain\">.<\/code><code class=\"php variable\">$cat_id<\/code><code class=\"php plain\">; <\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"php spaces\">\u00a0\u00a0<\/code><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"php variable\">$catimg<\/code> <code class=\"php plain\">= get_field(<\/code><code class=\"php string\">'catimg'<\/code><code class=\"php plain\">,<\/code><code class=\"php variable\">$post_id<\/code><code class=\"php plain\">);<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"php variable\">$img<\/code> <code class=\"php plain\">= wp_get_attachment_image_src(<\/code><code class=\"php variable\">$catimg<\/code><code class=\"php plain\">, <\/code><code class=\"php string\">'full'<\/code><code class=\"php plain\">);<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"php plain\">?&gt;<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"php plain\">&lt;div&gt;&lt;?php <\/code><code class=\"php functions\">echo<\/code> <code class=\"php variable\">$category<\/code><code class=\"php plain\">-&gt;cat_name; ?&gt;&lt;\/div&gt;<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"php plain\">&lt;div&gt;&lt;a href=<\/code><code class=\"php string\">\"category\/&lt;?php echo $category-&gt;category_nicename; ?&gt;\"<\/code><code class=\"php plain\">&gt;&lt;img src=<\/code><code class=\"php string\">\"&lt;?php echo $img[0]; ?&gt;\"<\/code> <code class=\"php plain\">alt=<\/code><code class=\"php string\">\"&lt;?php echo $category-&gt;cat_name; ?&gt;\"<\/code> <code class=\"php plain\">\/&gt;&lt;\/a&gt;&lt;\/div&gt;<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"php plain\">&lt;?php <\/code><code class=\"php keyword\">endforeach<\/code><code class=\"php plain\">; ?&gt;<\/code><\/div>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u306e\u30ab\u30c6\u30b4\u30ea\u306b\u753b\u50cf\u3092\u767b\u9332\u3057\u3066\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u306b\u30ab\u30c6\u30b4\u30ea\u30fc\u4e00\u89a7\u3068\u3057\u3066\u8868\u793a\u3057\u305f\u3044\u3068\u304d\u304c\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u305d\u3093\u306a\u6642\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u30ab\u30c6\u30b4\u30ea\u306b\u753b\u50cf\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002 [Advanced C [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-21 23:02:20","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1007"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=1007"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/1007\/revisions"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=1007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=1007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=1007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}