{"id":33672,"date":"2026-11-14T05:18:03","date_gmt":"2026-11-13T20:18:03","guid":{"rendered":"https:\/\/kimassi.net\/zak\/?p=33672"},"modified":"2026-11-14T06:34:25","modified_gmt":"2026-11-13T21:34:25","slug":"%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e5%88%a5%e3%81%ae%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%a7%e5%90%8c%e3%81%98%e3%82%ab%e3%83%86%e3%82%b4%e3%83%aa%e3%81%ae%e6%8a%95%e7%a8%bf%e4%b8%80%e8%a6%a7%e3%82%92","status":"publish","type":"post","link":"https:\/\/kimassi.net\/zak\/?p=33672","title":{"rendered":"\u30ab\u30c6\u30b4\u30ea\u5225\u306e\u30da\u30fc\u30b8\u3067\u540c\u3058\u30ab\u30c6\u30b4\u30ea\u306e\u6295\u7a3f\u4e00\u89a7\u3092\u8868\u793a"},"content":{"rendered":"<p>WordPress\u3067\u6614\u306e\u307e\u307e\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3044\u305f\u3089\u3001PHP\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\nPHP\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u3059\u308b\u3068\u30a8\u30e9\u30fc\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u3059\u3002<br \/>\n\u305d\u308c\u3067\u73fe\u5728\u4f7f\u3063\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePHP\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3082\u306e\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305d\u306e\u4e2d\u306bMy Category Order\u304c\u3001\u3042\u3063\u305f\u306e\u3067\u3059\u304c\u3001My Category Order\u3092\u524a\u9664\u3057\u305f\u3089\u3001\u30ab\u30c6\u30b4\u30ea\u306e\u30da\u30fc\u30b8\u306b\u5165\u3063\u3066\u3082\u3001\u305d\u306e\u30ab\u30c6\u30b4\u30ea\u306e\u30da\u30fc\u30b8\u4e00\u89a7\u304c\u898b\u308c\u306a\u3044\u306e\u3067\u90fd\u5408\u304c\u60aa\u3044\u3067\u3059\u3002<\/p>\n<p><strong>https:\/\/web-dev.tech\/wordpress\/customize\/display-related-posts-from-the-same-categories\/<\/strong><br \/>\n\u3092\u53c2\u8003\u306b\u3057\u3066\u3001\u4f7f\u3063\u3066\u3044\u308bthemes\uff08wp-content\\themes\\*******\u306ecategory.php\uff09\u3092\u66f8\u304d\u63db\u3048\u3066\u4e0b\u8a18\u3092\u633f\u5165\u3057\u307e\u3057\u305f\u3002<br \/>\n\u633f\u5165\u3059\u308b\u4f4d\u7f6e\u306f<\/p>\n<p>&lt;div id=&#8221;container&#8221;&gt;<br \/>\n&lt;div id=&#8221;content&#8221; role=&#8221;main&#8221;&gt;<br \/>\n&lt;h1 class=&#8221;page-title&#8221;&gt;&lt;?php<br \/>\nprintf( __( &#8216;Category Archives: %s&#8217;, &#8216;twentyten&#8217; ), &#8216;&lt;span&gt;&#8217; . single_cat_title( &#8221;, false ) . &#8216;&lt;\/span&gt;&#8217; );<br \/>\n?&gt;&lt;\/h1&gt;<br \/>\n\u306e\u4e0b\u3067\u3059<\/p>\n<p><span style=\"color: #0000ff;\">&lt;?php<\/span><br \/>\n<span style=\"color: #0000ff;\">$cat_id = get_queried_object()-&gt;term_id; \/\/ \u30ab\u30c6\u30b4\u30ea\u30fc\u3092\u53d6\u5f97<\/span><\/p>\n<p><span style=\"color: #0000ff;\">$args = [<\/span><br \/>\n<span style=\"color: #0000ff;\">&#8216;post_type&#8217; =&gt; &#8216;post&#8217;, \/\/ \u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u6307\u5b9a<\/span><br \/>\n<span style=\"color: #0000ff;\">&#8216;posts_per_page&#8217; =&gt; &#8216;100&#8217;, \/\/ \u8868\u793a\u3059\u308b\u8a18\u4e8b\u6570\u3092\u6307\u5b9a<\/span><br \/>\n<span style=\"color: #0000ff;\">&#8216;category__in&#8217; =&gt; $cat_id, \/\/ \u30ab\u30c6\u30b4\u30ea\u30fcID\u3092\u6307\u5b9a<\/span><br \/>\n<span style=\"color: #0000ff;\">];<\/span><\/p>\n<p><span style=\"color: #0000ff;\">$related_cats_query = new WP_Query($args);<\/span><br \/>\n<span style=\"color: #0000ff;\">?&gt;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">&lt;div class=&#8221;related-posts&#8221;&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?php if ($related_cats_query-&gt;have_posts()) : ?&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;ul&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?php while ($related_cats_query-&gt;have_posts()) : $related_cats_query-&gt;the_post(); ?&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;li&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;a href=&#8221;&lt;?php the_permalink(); ?&gt;&#8221;&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?php the_title(); ?&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;\/a&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;\/li&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?php endwhile; ?&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;\/ul&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?php else : ?&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;p&gt;\u95a2\u9023\u8a18\u4e8b\u306f\u3042\u308a\u307e\u305b\u3093\u3002&lt;\/p&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\">&lt;?p<br \/>\nendif;<br \/>\nwp_reset_postdata(); ?&gt;<br \/>\n&lt;\/div&gt;<\/span><\/p>\n<p>\u5e0c\u671b\u901a\u308a\u306e\u8868\u793a\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u3067\u6614\u306e\u307e\u307e\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u3066\u3044\u305f\u3089\u3001PHP\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 PHP\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3092\u3059\u308b\u3068\u30a8\u30e9\u30fc\u8868\u793a\u306b\u306a\u308b\u306e\u3067\u3059\u3002 \u305d\u308c\u3067\u73fe\u5728\u4f7f\u3063\u3066\u3044\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306ePHP\u306b\u5bfe\u5fdc\u3057\u3066 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,17,19],"tags":[],"class_list":["post-33672","post","type-post","status-publish","format-standard","hentry","category-php","category-17","category-19"],"_links":{"self":[{"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/posts\/33672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33672"}],"version-history":[{"count":9,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/posts\/33672\/revisions"}],"predecessor-version":[{"id":33682,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=\/wp\/v2\/posts\/33672\/revisions\/33682"}],"wp:attachment":[{"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kimassi.net\/zak\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}