{"id":4064,"date":"2026-10-11T09:00:00","date_gmt":"2026-10-11T00:00:00","guid":{"rendered":"https:\/\/wptoolslab.com\/query-lab\/?post_type=wpq_article&#038;p=4064"},"modified":"2026-09-14T13:51:32","modified_gmt":"2026-09-14T04:51:32","slug":"the-post-in-loop","status":"publish","type":"wpq_article","link":"https:\/\/wptoolslab.com\/query-lab\/articles\/the-post-in-loop\/","title":{"rendered":"WordPress\u3067\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u306b\u30bf\u30a4\u30c8\u30eb\u30fb\u672c\u6587\u3092\u6b63\u3057\u304f\u8868\u793a\u3059\u308b\u65b9\u6cd5\uff5cthe_post()\u306e\u4f7f\u3044\u65b9\u3068\u5f79\u5272"},"content":{"rendered":"<section class=\"conclusion wpq-conclusion\"><h2 class=\"wpq-conclusion__title\">\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u3067\u306fthe_post()\u3092while\u306e\u76f4\u5f8c\u3001\u8868\u793a\u306e\u524d\u306b\u7f6e\u304f<\/h2><p>\u95a2\u9023\u8a18\u4e8b\u3084\u65b0\u7740\u8a18\u4e8b\u306e\u4e00\u89a7\u3067\u306f\u3001`have_posts()`\u3067\u6b21\u306e\u6295\u7a3f\u304c\u3042\u308b\u304b\u3092\u78ba\u304b\u3081\u3001`the_post()`\u3067\u8868\u793a\u3059\u308b\u6295\u7a3f\u3078\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u7d9a\u304f`the_title()`\u3084`the_content()`\u306f\u3001\u305d\u306e\u6295\u7a3f\u306e\u30bf\u30a4\u30c8\u30eb\u3068\u672c\u6587\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>`new WP_Query()`\u306e\u7d50\u679c\u3092`$list_query`\u3078\u5165\u308c\u305f\u5834\u5408\u306f\u3001`while`\u306e\u76f4\u5f8c\u306b`$list_query->the_post()`\u30921\u56de\u547c\u3073\u307e\u3059\u3002\u6295\u7a3fID\u3092\u95a2\u6570\u3078\u6e21\u3057\u3066\u30bf\u30a4\u30c8\u30eb\u3084URL\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b\u5b9f\u88c5\u3067\u306f\u3001`the_post()`\u3092\u4f7f\u308f\u306a\u3044\u65b9\u6cd5\u3082\u9078\u3079\u307e\u3059\u3002<\/p>\n<\/section>\n<h2 id=\"roles\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"workflow\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\" \/>\n  <path d=\"M7 11v4a2 2 0 0 0 2 2h4\" \/>\n  <rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u95a2\u9023\u8a18\u4e8b\u306e\u4e00\u89a7\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u3067\u8868\u793a\u3059\u308b\u6e96\u5099<\/span><\/h2>\n<p>\u95a2\u9023\u8a18\u4e8b\u3084\u65b0\u7740\u8a18\u4e8b\u306e\u4e00\u89a7\u3092\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\u3067\u306f\u3001`have_posts()`\u3068`the_post()`\u304c\u7d9a\u3051\u3066\u51fa\u3066\u304d\u307e\u3059\u3002\u540d\u524d\u304c\u4f3c\u3066\u3044\u3066\u3082\u3001<span class=\"wpq-marker wpq-marker--yellow\">\u524d\u8005\u306f\u6b21\u306e\u6295\u7a3f\u304c\u3042\u308b\u304b\u306e\u78ba\u8a8d\u3001\u5f8c\u8005\u306f\u8868\u793a\u3059\u308b\u6295\u7a3f\u306e\u5207\u308a\u66ff\u3048<\/span>\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u540c\u3058A\u30fbB\u30fbC\u306e3\u8a18\u4e8b\u3092\u4f7f\u3044\u3001`the_post()`\u306e\u4f4d\u7f6e\u3060\u3051\u3092\u5909\u3048\u3066\u8868\u793a\u3092\u6bd4\u3079\u307e\u3059\u3002\u9806\u756a\u306b\u51fa\u308c\u3070\u6b63\u5e38\u3001\u540c\u3058\u8a18\u4e8b\u306e\u7e70\u308a\u8fd4\u3057\u30841\u4ef6\u305a\u308c\u304c\u3042\u308c\u3070\u547c\u3073\u51fa\u3057\u65b9\u3092\u898b\u76f4\u3059\u3001\u3068\u3044\u3046\u4f8b\u3067\u3059\u3002\u30b3\u30fc\u30c9\u306eID 61\u30fb62\u30fb63\u304cA\u30fbB\u30fbC\u3001ID 64\u304c\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u304f\u5143\u306e\u30da\u30fc\u30b8\u306b\u5f53\u305f\u308a\u307e\u3059\u3002\u81ea\u5206\u306e\u74b0\u5883\u3067\u8a66\u3059\u3068\u304d\u306f\u3001\u5b9f\u5728\u3059\u308b\u6295\u7a3fID\u3078\u7f6e\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>`$list_query`\u306f\u3001\u53d6\u5f97\u7d50\u679c\u3092\u53d7\u3051\u53d6\u308b\u305f\u3081\u306b\u3053\u306e\u4f8b\u3067\u4ed8\u3051\u305f\u5909\u6570\u540d\u3067\u3059\u3002\u3053\u306e\u7d50\u679c\u3092`while`\u30671\u4ef6\u305a\u3064\u8868\u793a\u3059\u308b\u51e6\u7406\u3092\u3001\u3053\u3053\u3067\u306f\u300c\u8ffd\u52a0\u30eb\u30fc\u30d7\u300d\u3068\u547c\u3073\u307e\u3059\u3002\u4eca\u56de\u306f\u95a2\u9023\u8a18\u4e8b\u3092\u81ea\u52d5\u3067\u9078\u3076\u65b9\u6cd5\u3067\u306f\u306a\u304f\u3001\u540c\u30583\u4ef6\u3067`the_post()`\u306e\u547c\u3073\u51fa\u3057\u4f4d\u7f6e\u3092\u6bd4\u3079\u307e\u3059\u3002<\/p>\n<p>`new WP_Query()`\u306e\u57fa\u672c\u7684\u306a\u66f8\u304d\u65b9\u3092\u5148\u306b\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e\u8a18\u4e8b\u304b\u3089\u8aad\u3080\u3068\u30b3\u30fc\u30c9\u306e\u6d41\u308c\u304c\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\n<div class=\"wpq-related-links\"><a class=\"deep-link-card wpq-related-link wpq-related-link--internal\" href=\"https:\/\/wptoolslab.com\/query-lab\/articles\/wp-query-basic-syntax\/\"><span class=\"article-thumb wpq-related-link__thumb\"><img decoding=\"async\" alt=\"WP_Query\u306e\u57fa\u672c\u69cb\u6587\u3068$args\u306e\u66f8\u304d\u65b9\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/wp-query-basic-syntax-card-1.png\" loading=\"lazy\" \/><\/span><div class=\"deep-link-copy wpq-related-link__copy\"><small>\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/small><b>WP_Query\u306e\u57fa\u672c\u69cb\u6587\u3068$args\u306e\u66f8\u304d\u65b9<\/b><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080<\/span><\/span><\/div><\/a><a class=\"deep-link-card wpq-related-link wpq-related-link--internal\" href=\"https:\/\/wptoolslab.com\/query-lab\/articles\/wp-query-basics\/\"><span class=\"article-thumb wpq-related-link__thumb\"><img decoding=\"async\" alt=\"WP_Query\u3068\u306f\uff1f\u521d\u5fc3\u8005\u5411\u3051\u306b\u5f79\u5272\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/wp-query-basics-card.png\" loading=\"lazy\" \/><\/span><div class=\"deep-link-copy wpq-related-link__copy\"><small>\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/small><b>WP_Query\u3068\u306f\uff1f\u521d\u5fc3\u8005\u5411\u3051\u306b\u5f79\u5272\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac<\/b><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080<\/span><\/span><\/div><\/a><\/div>\n<p>`new WP_Query()`\u306f\u3001\u6761\u4ef6\u306b\u5408\u3046\u6295\u7a3f\u3092`$list_query-&gt;posts`\u3078\u4fdd\u5b58\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u53d6\u5f97\u3057\u305f\u3060\u3051\u3067\u306f\u3001`the_title()`\u3084`the_content()`\u304c\u3069\u306e\u6295\u7a3f\u3092\u8868\u793a\u3059\u308b\u304b\u307e\u3067\u306f\u5207\u308a\u66ff\u308f\u308a\u307e\u305b\u3093\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: \u51e6\u7406 \/ \u5f79\u5272 \/ \u3053\u306e\u51e6\u7406\u3060\u3051\u3067\u5909\u308f\u308b\u3082\u306e\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u51e6\u7406<\/th><th>\u5f79\u5272<\/th><th>\u3053\u306e\u51e6\u7406\u3060\u3051\u3067\u5909\u308f\u308b\u3082\u306e<\/th><\/tr><\/thead><tbody><tr><td>have_posts()<\/td><td>\u6b21\u306b\u8868\u793a\u3067\u304d\u308b\u6295\u7a3f\u304c\u3042\u308b\u304b\u78ba\u8a8d\u3059\u308b<\/td><td>true \/ false\u3092\u8fd4\u3059\u3002\u30eb\u30fc\u30d7\u4f4d\u7f6e\u306f\u9032\u3081\u306a\u3044<\/td><\/tr><tr><td>the_post()<\/td><td>\u53d6\u5f97\u7d50\u679c\u3092\u6b21\u306e1\u4ef6\u3078\u9032\u3081\u3001\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3059\u308b<\/td><td>current_post\u304c\u9032\u307f\u3001global $post\u3068get_the_ID()\u304c\u305d\u306e\u6295\u7a3f\u3092\u4f7f\u3046<\/td><\/tr><tr><td>the_title() \/ the_content()<\/td><td>the_post()\u3067\u6e96\u5099\u3057\u305f\u6295\u7a3f\u3092\u8868\u793a\u3059\u308b<\/td><td>\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u3092\u51fa\u529b\u3059\u308b\u3002\u6b21\u306e\u6295\u7a3f\u3078\u306f\u9032\u3081\u306a\u3044<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>WordPress\u516c\u5f0f\u306e`WP_Query::the_post()`\u306f\u3001\u6b21\u306e\u6295\u7a3f\u3092\u53d6\u308a\u51fa\u3057\u3001\u305d\u306e\u6295\u7a3f\u3092\u30eb\u30fc\u30d7\u5185\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u6e96\u5099\u3057\u307e\u3059\u3002`the_post()`\u81ea\u4f53\u304c\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u3092\u8868\u793a\u3059\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u306a\u304a\u3001`have_posts()`\u306f\u6b21\u306e\u6295\u7a3f\u3078\u9032\u3081\u308b\u95a2\u6570\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30eb\u30fc\u30d7\u7d42\u4e86\u6642\u306b\u306f\u30af\u30a8\u30ea\u5185\u306e\u4f4d\u7f6e\u3092\u5dfb\u304d\u623b\u3059\u51e6\u7406\u3082\u884c\u3044\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--red\">`while ( $query-&gt;have_posts() )`\u3060\u3051\u3067\u56de\u3059\u3068\u3001\u30eb\u30fc\u30d7\u4f4d\u7f6e\u304c\u9032\u307e\u306a\u3044\u305f\u3081\u540c\u3058true\u5224\u5b9a\u304c\u7d9a\u304d\u307e\u3059\u3002\u30eb\u30fc\u30d7\u5185\u3067\u5fc5\u305a\u6b21\u3078\u9032\u3080\u51e6\u7406\u304c\u5fc5\u8981\u3067\u3059\u3002<\/span>\n<h2 id=\"correct-position\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"code\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m18 16 4-4-4-4\" \/>\n  <path d=\"m6 8-4 4 4 4\" \/>\n  <path d=\"m14.5 4-5 16\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u6b63\u3057\u3044\u4f4d\u7f6e\u306fwhile\u306e\u76f4\u5f8c\u30fb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u524d<\/span><\/h2>\n<p>`while`\u306e\u4e2d\u3067\u3001\u8a18\u4e8b\u3092\u8868\u793a\u3059\u308b\u524d\u306b`the_post()`\u3092\u66f8\u304d\u307e\u3059\u3002\u6b21\u306f\u30af\u30e9\u30b7\u30c3\u30af\u30c6\u30fc\u30de\u306e\u4f8b\u3067\u3001\u5b50\u30c6\u30fc\u30de\u306e`template-part.php`\u306b\u3042\u308bPHP\u306e\u51e6\u7406\u3078\u8ffd\u52a0\u3059\u308b\u90e8\u5206\u3067\u3059\u3002\u65b0\u3057\u304f\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u5834\u5408\u306f\u3001\u5148\u982d\u306b`&lt;?php`\u3092\u4ed8\u3051\u3066\u304b\u3089\u30b3\u30fc\u30c9\u3092\u5165\u308c\u307e\u3059\u3002\u3059\u3067\u306bPHP\u304c\u59cb\u307e\u3063\u3066\u3044\u308b\u5834\u6240\u3078\u8ffd\u52a0\u3059\u308b\u306a\u3089\u3001\u958b\u59cb\u30bf\u30b0\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n<p>\u500b\u5225\u8a18\u4e8b\u3078\u8868\u793a\u3059\u308b\u5834\u5408\u306f\u3001\u5b9f\u969b\u306b\u4f7f\u308f\u308c\u308b`single.php`\u306e\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u5185\u3067\u3001`the_content()`\u306e\u5f8c\u306a\u3069\u3078`get_template_part( &#8216;template-part&#8217; );`\u3092\u8ffd\u52a0\u3057\u3066\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">\u30d1\u30fc\u30c4\u3092\u4fdd\u5b58\u3059\u308b\u3060\u3051\u3067\u306f\u8868\u793a\u3055\u308c\u306a\u3044\u305f\u3081\u3001\u8868\u793a\u5143\u304b\u3089\u306e\u547c\u3073\u51fa\u3057\u3082\u5fc5\u8981\u3067\u3059\u3002<\/span>\u4e0b\u306e\u30b3\u30fc\u30c9\u306f\u3001\u5143\u306e\u8a18\u4e8b\u306e`the_post()`\u304c\u5b9f\u884c\u3055\u308c\u305f\u5f8c\u306b\u52d5\u304b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"wpq-code-context wpq-code-context--template\"><span class=\"wpq-code-context__icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"folder-open\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" \/>\n<\/svg><\/span><p>\u30af\u30e9\u30b7\u30c3\u30af\u30c6\u30fc\u30de\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08\u307e\u305f\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d1\u30fc\u30c4\uff09\u3067\u3001\u4e00\u89a7\u3092\u8868\u793a\u3057\u305f\u3044\u4f4d\u7f6e\u306b\u7f6e\u304f\u4f8b\u3067\u3059\u3002\u6295\u7a3f\u672c\u6587\u3084functions.php\u3078\u3001\u305d\u306e\u307e\u307e\u8cbc\u308b\u30b3\u30fc\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p><\/div><div class=\"code-head wpq-code-head\"><div class=\"code-meta wpq-code-meta\"><span class=\"code-lang wpq-code-pill wpq-code-pill--lang\">PHP<\/span><span class=\"code-filename wpq-code-pill\">template-part.php<\/span><span class=\"code-purpose wpq-code-pill\">the_post()\u3092\u6b63\u3057\u3044\u4f4d\u7f6e\u3078\u7f6e\u304f\u8ffd\u52a0\u30eb\u30fc\u30d7<\/span><\/div><button type=\"button\" class=\"copy-button wpq-copy-button\">\u30b3\u30d4\u30fc<\/button><\/div><pre data-wpq-code-region data-wpq-code-label=\"\u30b3\u30fc\u30c9\u4f8b: the_post()\u3092\u6b63\u3057\u3044\u4f4d\u7f6e\u3078\u7f6e\u304f\u8ffd\u52a0\u30eb\u30fc\u30d7 \/ template-part.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-var\">$list_query<\/span> = <span class=\"c-keyword\">new<\/span> <span class=\"c-fn\">WP_Query<\/span>(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   [&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post_type&#039;<\/span>      =&gt; <span class=\"c-str\">&#039;post&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post_status&#039;<\/span>    =&gt; <span class=\"c-str\">&#039;publish&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;posts_per_page&#039;<\/span> =&gt; <span class=\"c-num\">3<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post__in&#039;<\/span>       =&gt; [ <span class=\"c-num\">61<\/span>, <span class=\"c-num\">62<\/span>, <span class=\"c-num\">63<\/span> ],&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;orderby&#039;<\/span>       =&gt; <span class=\"c-str\">&#039;post__in&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;ignore_sticky_posts&#039;<\/span> =&gt; <span class=\"c-keyword\">true<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   ]&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">);&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-keyword\">if<\/span> ( <span class=\"c-var\">$list_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">while<\/span> ( <span class=\"c-var\">$list_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$list_query<\/span>-&gt;the_post();&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;article&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      the_title( <span class=\"c-str\">&#039;&lt;h2&gt;&#039;<\/span>, <span class=\"c-str\">&#039;&lt;\/h2&gt;&#039;<\/span> );&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      the_content();&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;\/article&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   }&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">} <span class=\"c-keyword\">else<\/span> {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;p&gt;\u8868\u793a\u3067\u304d\u308b\u6295\u7a3f\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002&lt;\/p&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">}&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;wp_reset_postdata();&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\n$list_query = new WP_Query(&lt;br \/&gt;\n   [&lt;br \/&gt;\n      &#039;post_type&#039;      =&gt; &#039;post&#039;,&lt;br \/&gt;\n      &#039;post_status&#039;    =&gt; &#039;publish&#039;,&lt;br \/&gt;\n      &#039;posts_per_page&#039; =&gt; 3,&lt;br \/&gt;\n      &#039;post__in&#039;       =&gt; [ 61, 62, 63 ],&lt;br \/&gt;\n      &#039;orderby&#039;       =&gt; &#039;post__in&#039;,&lt;br \/&gt;\n      &#039;ignore_sticky_posts&#039; =&gt; true,&lt;br \/&gt;\n   ]&lt;br \/&gt;\n);&lt;\/p&gt;\n&lt;p&gt;if ( $list_query-&gt;have_posts() ) {&lt;br \/&gt;\n   while ( $list_query-&gt;have_posts() ) {&lt;br \/&gt;\n      $list_query-&gt;the_post();&lt;\/p&gt;\n&lt;p&gt;      echo &#039;&lt;article&gt;&#039;;&lt;br \/&gt;\n      the_title( &#039;&lt;h2&gt;&#039;, &#039;&lt;\/h2&gt;&#039; );&lt;br \/&gt;\n      the_content();&lt;br \/&gt;\n      echo &#039;&lt;\/article&gt;&#039;;&lt;br \/&gt;\n   }&lt;br \/&gt;\n} else {&lt;br \/&gt;\n   echo &#039;&lt;p&gt;\u8868\u793a\u3067\u304d\u308b\u6295\u7a3f\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002&lt;\/p&gt;&#039;;&lt;br \/&gt;\n}&lt;\/p&gt;\n&lt;p&gt;wp_reset_postdata();&lt;br \/&gt;<\/textarea><\/div>\n<p>`have_posts()`\u304ctrue\u306b\u306a\u3063\u305f\u76f4\u5f8c\u306b`$list_query-&gt;the_post()`\u3092\u547c\u3076\u305f\u3081\u3001\u305d\u306e\u4e0b\u306e`the_title()`\u3068`the_content()`\u306f\u540c\u3058\u6295\u7a3f\u3092\u53c2\u7167\u3057\u307e\u3059\u30021\u5468\u306b\u3064\u304d1\u56de\u3060\u3051\u547c\u3076\u3068\u3001\u53d6\u5f97\u9806\u3069\u304a\u308a\u306b1\u4ef6\u305a\u3064\u9032\u307f\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u753b\u50cf\u306f\u3001\u5171\u901a\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30c8\u3067\u5b9f\u969b\u306b`WP_Query`\u3092\u52d5\u304b\u3057\u305f\u753b\u9762\u3067\u3059\u3002\u30da\u30fc\u30b8\u5185\u306e\u95a2\u9023\u8a18\u4e8b\u306b\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bA\u30fbB\u30fbC\u304c\u4e0a\u304b\u3089\u53d6\u5f97\u9806\u306b\u4e26\u3093\u3067\u3044\u307e\u3059\u3002\u4e0b\u90e8\u306e\u78ba\u8a8d\u5024\u3067\u3082\u3001`current_post`\u304c0\u30fb1\u30fb2\u3068\u9032\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<figure class=\"wpq-screenshot-frame wpq-screenshot-frame--fit-contain\"><span class=\"wpq-screenshot-frame__media\" style=\"--wpq-screenshot-ratio:3036 \/ 2295;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/the-post-in-loop-SC-01-scaled.png\" alt=\"\u540c\u3058\u30b5\u30f3\u30d7\u30eb\u30da\u30fc\u30b8\u306e\u95a2\u9023\u8a18\u4e8b\u306b\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bA\u30fbB\u30fbC\u304cID 61\u30fb62\u30fb63\u306e\u9806\u3067\u8868\u793a\u3055\u308c\u305f\u753b\u9762\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u6b63\u5e38\u306a\u8868\u793a<\/span><strong class=\"wpq-screenshot-frame__title\">A\u30fbB\u30fbC\u3092\u53d6\u5f97\u9806\u306b\u8868\u793a\u3067\u304d\u3066\u3044\u308b<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u7dd1\u67a0\u306e\u95a2\u9023\u8a18\u4e8b\u306fA\u30fbB\u30fbC\u306e\u9806\u3067\u3059\u3002\u4e0b\u90e8\u306ecurrent_post\u30820\u21921\u21922\u3068\u9032\u307f\u307e\u3059\u3002<\/p><\/figcaption><\/figure>\n<p>\u4e00\u89a7\u3067\u672c\u6587\u5168\u4f53\u304c\u4e0d\u8981\u306a\u3089\u3001`the_content()`\u3092\u629c\u7c8b\u3084\u4efb\u610f\u306e\u8868\u793a\u3078\u5909\u66f4\u3067\u304d\u307e\u3059\u3002\u8868\u793a\u5185\u5bb9\u3092\u5909\u3048\u3066\u3082\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u3092\u4f7f\u3046\u524d\u306b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3059\u308b\u9806\u756a\u306f\u540c\u3058\u3067\u3059\u3002<\/p>\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u672c\u756a\u3068\u5206\u3051\u305fWordPress\u74b0\u5883\u3067\u3001A\u30fbB\u30fbC\u304c\u9806\u756a\u306b\u8868\u793a\u3055\u308c\u308b\u304b\u8a66\u3057\u307e\u3059\u3002\u691c\u8a3c\u3084\u516c\u958b\u306b\u4f7f\u3046\u30b5\u30fc\u30d0\u30fc\u3092\u3053\u308c\u304b\u3089\u7528\u610f\u3059\u308b\u5834\u5408\u306f\u3001Xserver\u306e\u6599\u91d1\u3084\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u6761\u4ef6\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u3092\u5909\u3048\u308b\u3060\u3051\u3067the_post()\u306e\u4f4d\u7f6e\u304c\u76f4\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n<h2 id=\"main-vs-custom\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"map\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z\" \/>\n  <path d=\"M15 5.764v15\" \/>\n  <path d=\"M9 3.236v15\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">WordPress\u6a19\u6e96\u306e\u4e00\u89a7\u3068\u3001\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u3067\u306f\u547c\u3073\u51fa\u3057\u65b9\u304c\u5909\u308f\u308b<\/span><\/h2>\n<p>\u95a2\u6570\u3068\u3057\u3066\u66f8\u304f`the_post()`\u306f\u3001WordPress\u304cURL\u306b\u5408\u308f\u305b\u3066\u7528\u610f\u3057\u305f\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u9032\u3081\u307e\u3059\u3002\u4e00\u65b9\u3001`$list_query-&gt;the_post()`\u306f\u3001\u3053\u306e\u4f8b\u3067\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u3092\u9032\u3081\u307e\u3059\u3002`-&gt;`\u306f\u3001\u5de6\u5074\u306e`$list_query`\u306b\u5bfe\u3057\u3066\u53f3\u5074\u306e\u51e6\u7406\u3092\u547c\u3073\u51fa\u3059\u66f8\u304d\u65b9\u3067\u3059\u3002\u3053\u306e\u3088\u3046\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u901a\u3058\u3066\u547c\u3076\u95a2\u6570\u3092\u300c\u30e1\u30bd\u30c3\u30c9\u300d\u3068\u547c\u3073\u307e\u3059\u3002\u3069\u306e\u4e00\u89a7\u3092\u9032\u3081\u308b\u304b\u306b\u3088\u3063\u3066\u3001\u6b21\u306e\u3088\u3046\u306b\u66f8\u304d\u5206\u3051\u307e\u3059\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: \u8868\u793a\u3059\u308b\u4e00\u89a7 \/ \u6b21\u306e\u6295\u7a3f\u3092\u78ba\u304b\u3081\u308b \/ \u8868\u793a\u3059\u308b\u6295\u7a3f\u3078\u5207\u308a\u66ff\u3048\u308b\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u8868\u793a\u3059\u308b\u4e00\u89a7<\/th><th>\u6b21\u306e\u6295\u7a3f\u3092\u78ba\u304b\u3081\u308b<\/th><th>\u8868\u793a\u3059\u308b\u6295\u7a3f\u3078\u5207\u308a\u66ff\u3048\u308b<\/th><\/tr><\/thead><tbody><tr><td>WordPress\u6a19\u6e96\u306e\u30e1\u30a4\u30f3\u4e00\u89a7<\/td><td>have_posts()<\/td><td>the_post()<\/td><\/tr><tr><td>$list_query\u3067\u8ffd\u52a0\u3057\u305f\u4e00\u89a7<\/td><td>$list_query-&gt;have_posts()<\/td><td>$list_query-&gt;the_post()<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u8ffd\u52a0\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u95a2\u6570`the_post()`\u3092\u547c\u3076\u3068\u3001\u610f\u56f3\u3057\u305f`$list_query`\u3067\u306f\u306a\u304f\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u9032\u3081\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u3067\u306f\u3001have_posts()\u3068the_post()\u306e\u5de6\u5074\u3092\u540c\u3058\u30af\u30a8\u30ea\u5909\u6570\u306b\u305d\u308d\u3048\u307e\u3059\u3002<\/span><\/p>\n<h2 id=\"without-the-post\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"warning\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" \/>\n  <path d=\"M12 9v4\" \/>\n  <path d=\"M12 17h.01\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">the_post()\u3092\u547c\u3070\u306a\u3044\u3068\u8868\u793a\u3059\u308b\u6295\u7a3f\u304c\u5207\u308a\u66ff\u308f\u3089\u306a\u3044<\/span><\/h2>\n<p>`WP_Query`\u3092\u4f5c\u308b\u3068\u3001\u53d6\u5f97\u7d50\u679c\u306f`$list_query-&gt;posts`\u3078\u5165\u308a\u307e\u3059\u3002\u4e00\u65b9\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u304c\u4f7f\u3046`global $post`\u306f\u3001`$list_query-&gt;the_post()`\u3092\u547c\u3076\u307e\u3067\u5143\u306e\u8a18\u4e8b\u306e\u307e\u307e\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306f\u4ed5\u7d44\u307f\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306e\u5931\u6557\u4f8b\u3067\u3059\u3002\u6295\u7a3f\u304c\u3042\u308b\u3068\u7d42\u4e86\u3057\u306a\u3044\u305f\u3081\u3001\u305d\u306e\u307e\u307e\u5b9f\u884c\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u6700\u521d\u306e\u30b3\u30fc\u30c9\u3067\u4f5c\u3063\u305f`$list_query`\u3092\u4f7f\u3063\u3066\u3082\u3001\u3053\u306e\u5f62\u3067\u306f\u30eb\u30fc\u30d7\u3092\u6b21\u3078\u9032\u3081\u308b\u51e6\u7406\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"code-head wpq-code-head\"><div class=\"code-meta wpq-code-meta\"><span class=\"code-lang wpq-code-pill wpq-code-pill--lang\">PHP<\/span><span class=\"code-filename wpq-code-pill\">template-part.php<\/span><span class=\"code-purpose wpq-code-pill\">the_post()\u304c\u306a\u304f\u9032\u307e\u306a\u3044\u5931\u6557\u4f8b<\/span><\/div><button type=\"button\" class=\"copy-button wpq-copy-button\">\u30b3\u30d4\u30fc<\/button><\/div><pre data-wpq-code-region data-wpq-code-label=\"\u30b3\u30fc\u30c9\u4f8b: the_post()\u304c\u306a\u304f\u9032\u307e\u306a\u3044\u5931\u6557\u4f8b \/ template-part.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-keyword\">while<\/span> ( <span class=\"c-var\">$list_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   the_title();&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   the_content();&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">}&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\nwhile ( $list_query-&gt;have_posts() ) {&lt;br \/&gt;\n   the_title();&lt;br \/&gt;\n   the_content();&lt;br \/&gt;\n}&lt;br \/&gt;<\/textarea><\/div>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u5b9f\u884c\u3057\u7d9a\u3051\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u6295\u7a3f\u304c\u3042\u308b\u5834\u5408\u3001`have_posts()`\u306e\u5224\u5b9a\u304ctrue\u306e\u307e\u307e\u306b\u306a\u308a\u3001\u540c\u3058\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002\u30bf\u30a4\u30c8\u30eb\u3068\u672c\u6587\u3082\u72ec\u81ea\u30af\u30a8\u30ea\u306e\u6295\u7a3f\u3078\u5207\u308a\u66ff\u308f\u3089\u305a\u3001\u76f4\u524d\u307e\u3067`global $post`\u306b\u5165\u3063\u3066\u3044\u305f\u8a18\u4e8b\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u753b\u50cf\u306e\u691c\u8a3c\u3067\u306f\u7121\u9650\u30eb\u30fc\u30d7\u3092\u907f\u3051\u308b\u305f\u3081\u30013\u56de\u3067\u6253\u3061\u5207\u308b`for`\u6587\u3067\u540c\u3058\u72b6\u614b\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u30023\u56de\u3068\u3082`current_post`\u306f-1\u306e\u307e\u307e\u3067\u3001\u753b\u9762\u306b\u306f\u53d6\u5f97\u3057\u305fA\u30fbB\u30fbC\u3067\u306f\u306a\u304f\u3001\u5143\u306e\u78ba\u8a8d\u30da\u30fc\u30b8\u304c\u7e70\u308a\u8fd4\u3057\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<figure class=\"wpq-screenshot-frame wpq-screenshot-frame--fit-contain\"><span class=\"wpq-screenshot-frame__media\" style=\"--wpq-screenshot-ratio:3036 \/ 2295;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/the-post-in-loop-SC-02-scaled.png\" alt=\"\u540c\u3058\u30b5\u30f3\u30d7\u30eb\u30da\u30fc\u30b8\u306e\u95a2\u9023\u8a18\u4e8b\u306b\u3001\u5143\u306e\u78ba\u8a8d\u30da\u30fc\u30b8ID 64\u304c3\u56de\u8868\u793a\u3055\u308c\u305f\u753b\u9762\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u547c\u3070\u306a\u3044\u5834\u5408<\/span><strong class=\"wpq-screenshot-frame__title\">\u30eb\u30fc\u30d7\u304c\u958b\u59cb\u524d\u306e\u307e\u307e\u9032\u307e\u306a\u3044<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u8d64\u67a0\u306e3\u4ef6\u304c\u3059\u3079\u3066\u5143\u306e\u30da\u30fc\u30b8ID 64\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002current_post\u306f3\u56de\u3068\u3082-1\u306e\u307e\u307e\u3067\u3059\u3002<\/p><\/figcaption><\/figure>\n<aside class=\"callout callout-warning wpq-callout wpq-callout--warning\"><p class=\"callout-title wpq-callout__title\"><span class=\"wpq-callout__icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"warning\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" \/>\n  <path d=\"M12 9v4\" \/>\n  <path d=\"M12 17h.01\" \/>\n<\/svg><\/span><span>query\u306epost\u30d7\u30ed\u30d1\u30c6\u30a3\u3060\u3051\u3067\u5224\u65ad\u3057\u306a\u3044<\/span><\/p><p>WP_Query\u306e\u53d6\u5f97\u76f4\u5f8c\u306f\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e`post`\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u5148\u982d\u6295\u7a3f\u3092\u6307\u3057\u3066\u3044\u3066\u3082\u3001`current_post`\u306f\u958b\u59cb\u524d\u306e`-1`\u3067\u3001`global $post`\u306f\u5143\u306e\u8a18\u4e8b\u306e\u307e\u307e\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u304c\u3069\u306e\u8a18\u4e8b\u3092\u4f7f\u3046\u304b\u306f\u3001`global $post`\u3068`get_the_ID()`\u3067\u3082\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<\/aside>\n<h2 id=\"wrong-position\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"warning\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" \/>\n  <path d=\"M12 9v4\" \/>\n  <path d=\"M12 17h.01\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u65e9\u3059\u304e\u308b\u3068\u5148\u982d\u3092\u98db\u3070\u3057\u3001\u9045\u3059\u304e\u308b\u30681\u4ef6\u305a\u308c\u308b<\/span><\/h2>\n<p>`the_post()`\u306f\u3001\u547c\u3076\u4f4d\u7f6e\u304c\u65e9\u3059\u304e\u3066\u3082\u9045\u3059\u304e\u3066\u3082\u8868\u793a\u304c\u305a\u308c\u307e\u3059\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: \u7f6e\u3044\u305f\u4f4d\u7f6e \/ \u8d77\u304d\u308b\u3053\u3068 \/ 3\u4ef6A\u30fbB\u30fbC\u306e\u8868\u793a\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u7f6e\u3044\u305f\u4f4d\u7f6e<\/th><th>\u8d77\u304d\u308b\u3053\u3068<\/th><th>3\u4ef6A\u30fbB\u30fbC\u306e\u8868\u793a<\/th><\/tr><\/thead><tbody><tr><td>while\u306e\u76f4\u5f8c\u3001\u8868\u793a\u524d<\/td><td>the_post()\u3067\u6e96\u5099\u3057\u305f\u6295\u7a3f\u3092\u305d\u306e\u307e\u307e\u8868\u793a\u3067\u304d\u308b<\/td><td>A\u3001B\u3001C<\/td><\/tr><tr><td>while\u3088\u308a\u524d\u306b\u30821\u56de\u547c\u3076<\/td><td>A\u3092\u8868\u793a\u524d\u306b\u6d88\u8cbb\u3059\u308b<\/td><td>B\u3001C<\/td><\/tr><tr><td>the_title()\u306a\u3069\u306e\u5f8c<\/td><td>\u8868\u793a\u6642\u70b9\u3067\u306f1\u3064\u524d\u306e\u6295\u7a3f\u3092\u4f7f\u3046<\/td><td>\u5143\u306e\u8a18\u4e8b\u3001A\u3001B\u3002C\u306f\u6e96\u5099\u5f8c\u306b\u30eb\u30fc\u30d7\u7d42\u4e86<\/td><\/tr><tr><td>\u547c\u3070\u306a\u3044<\/td><td>\u4f4d\u7f6e\u304c\u958b\u59cb\u524d\u304b\u3089\u9032\u307e\u306a\u3044<\/td><td>\u5143\u306e\u8a18\u4e8b\u3092\u8868\u793a\u3057\u305f\u307e\u307e\u5224\u5b9a\u304c\u7d9a\u304f<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u30eb\u30fc\u30d7\u524d\u306b\u5148\u982d\u6295\u7a3f\u3060\u3051\u6e96\u5099\u3057\u3066\u304b\u3089\u3001\u30eb\u30fc\u30d7\u5185\u3067\u3082`the_post()`\u3092\u547c\u3076\u3068\u3001\u6700\u521d\u306b\u8868\u793a\u3059\u308b\u307e\u3067\u306b2\u56de\u9032\u3080\u305f\u3081\u3001A\u3092\u98db\u3070\u3057\u3066B\u304b\u3089\u8868\u793a\u3057\u307e\u3059\u3002\u53cd\u5bfe\u306b\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u5f8c\u3067\u547c\u3076\u3068\u3001\u8868\u793a\u3068\u6295\u7a3f\u30c7\u30fc\u30bf\u306e\u6e96\u5099\u304c1\u5468\u305a\u3064\u305a\u308c\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">\u8ff7\u3063\u305f\u3089\u300c`have_posts()`\u3067\u6b21\u306e\u6295\u7a3f\u3092\u78ba\u8a8d \u2192 `the_post()`\u3067\u8868\u793a\u5bfe\u8c61\u3092\u5207\u308a\u66ff\u3048\u308b \u2192 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u3067\u8868\u793a\u300d\u306e\u9806\u756a\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3092\u898b\u76f4\u3057\u307e\u3059\u3002<\/span>\n<p>\u6b21\u306e\u753b\u9762\u3067\u306f\u3001\u8868\u793a\u3057\u305f\u3042\u3068\u306b`the_post()`\u3092\u547c\u3093\u3067\u3044\u307e\u3059\u30021\u56de\u76ee\u306f\u5143\u306e\u8a18\u4e8b\u30012\u56de\u76ee\u306f\u78ba\u8a8d\u7528\u8a18\u4e8bA\u30013\u56de\u76ee\u306f\u78ba\u8a8d\u7528\u8a18\u4e8bB\u3068\u306a\u308a\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bC\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<figure class=\"wpq-screenshot-frame wpq-screenshot-frame--fit-contain\"><span class=\"wpq-screenshot-frame__media\" style=\"--wpq-screenshot-ratio:3036 \/ 2295;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/the-post-in-loop-SC-03-scaled.png\" alt=\"\u540c\u3058\u30b5\u30f3\u30d7\u30eb\u30da\u30fc\u30b8\u306e\u95a2\u9023\u8a18\u4e8b\u304c\u3001\u5143\u306e\u30da\u30fc\u30b8ID 64\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bA\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bB\u306e\u9806\u306b\u306a\u3063\u305f\u753b\u9762\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u547c\u3076\u4f4d\u7f6e\u304c\u9045\u3044\u5834\u5408<\/span><strong class=\"wpq-screenshot-frame__title\">\u8868\u793a\u304c1\u4ef6\u305a\u3064\u9045\u308c\u3001\u6700\u5f8c\u306eC\u304c\u51fa\u306a\u3044<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u8d64\u67a0\u306f\u5143\u306e\u30da\u30fc\u30b8\u2192A\u2192B\u306e\u9806\u3067\u3001C\u304c\u3042\u308a\u307e\u305b\u3093\u3002current_post\u306f\u8868\u793a\u6642\u70b9\u3067-1\u21920\u21921\u3067\u3059\u3002<\/p><\/figcaption><\/figure>\n<h2 id=\"template-tags\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"search\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m21 21-4.34-4.34\" \/>\n  <circle cx=\"11\" cy=\"11\" r=\"8\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306fthe_post()\u3067\u6e96\u5099\u3057\u305f\u6295\u7a3f\u3092\u4f7f\u3046<\/span><\/h2>\n<p>`get_the_ID()`\u306f\u6295\u7a3fID\u3092\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u3089\u305a\u3001`the_post()`\u3067\u5207\u308a\u66ff\u3048\u305f\u6295\u7a3f\u306eID\u3092\u8fd4\u3057\u307e\u3059\u3002`the_title()`\u306f\u305d\u306e\u6295\u7a3f\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u3001`the_content()`\u306f\u305d\u306e\u6295\u7a3f\u306e\u672c\u6587\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u3078\u901a\u3057\u3066\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u53d6\u5f97\u3057\u305f\u3044\u6295\u7a3fID\u3092`get_the_ID()`\u3078\u6e21\u3057\u3066\u8868\u793a\u5bfe\u8c61\u3092\u5909\u3048\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u8ffd\u52a0\u30eb\u30fc\u30d7\u3067\u306f\u5148\u306b`$list_query-&gt;the_post()`\u3067\u8868\u793a\u3059\u308b\u6295\u7a3f\u3092\u6e96\u5099\u3059\u308b\u304b\u3001ID\u3084\u6295\u7a3f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d7\u3051\u53d6\u308c\u308b\u53d6\u5f97\u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: \u95a2\u6570 \/ \u3069\u306e\u6295\u7a3f\u3092\u4f7f\u3046\u304b \/ \u4e3b\u306a\u7528\u9014\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u95a2\u6570<\/th><th>\u3069\u306e\u6295\u7a3f\u3092\u4f7f\u3046\u304b<\/th><th>\u4e3b\u306a\u7528\u9014<\/th><\/tr><\/thead><tbody><tr><td>get_the_ID()<\/td><td>the_post()\u3067\u5207\u308a\u66ff\u3048\u305f\u6295\u7a3f<\/td><td>\u8ffd\u52a0\u30eb\u30fc\u30d7\u5185\u306e\u6295\u7a3fID\u3092\u53d6\u5f97<\/td><\/tr><tr><td>the_title()<\/td><td>the_post()\u3067\u5207\u308a\u66ff\u3048\u305f\u6295\u7a3f<\/td><td>\u8ffd\u52a0\u30eb\u30fc\u30d7\u5185\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a<\/td><\/tr><tr><td>the_content()<\/td><td>the_post()\u3067\u5207\u308a\u66ff\u3048\u305f\u6295\u7a3f<\/td><td>\u8ffd\u52a0\u30eb\u30fc\u30d7\u5185\u306e\u672c\u6587\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u5f8c\u306b\u8868\u793a<\/td><\/tr><tr><td>get_the_title( $post_id )<\/td><td>\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305fID\u307e\u305f\u306f\u6295\u7a3f<\/td><td>global $post\u3092\u5909\u3048\u305a\u306b\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97<\/td><\/tr><tr><td>get_permalink( $post_id )<\/td><td>\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305fID\u307e\u305f\u306f\u6295\u7a3f<\/td><td>global $post\u3092\u5909\u3048\u305a\u306bURL\u3092\u53d6\u5f97<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u30bf\u30a4\u30c8\u30eb\u3084URL\u3060\u3051\u3092\u6271\u3046\u5c0f\u3055\u306a\u51e6\u7406\u3067\u306f\u3001ID\u3092\u6307\u5b9a\u3059\u308b\u65b9\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u672c\u6587\u8868\u793a\u306f`the_content()`\u306e\u30d5\u30a3\u30eb\u30bf\u30fc\u51e6\u7406\u3084\u30eb\u30fc\u30d7\u306e\u72b6\u614b\u3082\u95a2\u4fc2\u3059\u308b\u305f\u3081\u3001\u901a\u5e38\u306e\u4e00\u89a7\u3067\u306f`have_posts()`\u3001`the_post()`\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u9806\u306b\u66f8\u304f\u65b9\u6cd5\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<h2 id=\"when-not-needed\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"lightbulb\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\" \/>\n  <path d=\"M9 18h6\" \/>\n  <path d=\"M10 22h4\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">the_post()\u3092\u4f7f\u308f\u306a\u3044\u65b9\u304c\u5358\u7d14\u306a\u30b1\u30fc\u30b9<\/span><\/h2>\n<p>\u53d6\u5f97\u3057\u305f\u6295\u7a3fID\u3092\u5225\u51e6\u7406\u3078\u6e21\u3059\u3060\u3051\u3001\u30bf\u30a4\u30c8\u30eb\u3068URL\u3092ID\u6307\u5b9a\u3067\u7d44\u307f\u7acb\u3066\u308b\u3060\u3051\u3001\u4ef6\u6570\u3092\u78ba\u8a8d\u3059\u308b\u3060\u3051\u306a\u3089\u3001`global $post`\u3092\u5207\u308a\u66ff\u3048\u305a\u306b\u51e6\u7406\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"wpq-code-context wpq-code-context--template\"><span class=\"wpq-code-context__icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"folder-open\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\" \/>\n<\/svg><\/span><p>\u30af\u30e9\u30b7\u30c3\u30af\u30c6\u30fc\u30de\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\uff08\u307e\u305f\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d1\u30fc\u30c4\uff09\u3067\u3001\u4e00\u89a7\u3092\u8868\u793a\u3057\u305f\u3044\u4f4d\u7f6e\u306b\u7f6e\u304f\u4f8b\u3067\u3059\u3002\u6295\u7a3f\u672c\u6587\u3084functions.php\u3078\u3001\u305d\u306e\u307e\u307e\u8cbc\u308b\u30b3\u30fc\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p><\/div><div class=\"code-head wpq-code-head\"><div class=\"code-meta wpq-code-meta\"><span class=\"code-lang wpq-code-pill wpq-code-pill--lang\">PHP<\/span><span class=\"code-filename wpq-code-pill\">template-part.php<\/span><span class=\"code-purpose wpq-code-pill\">\u6295\u7a3fID\u3092\u660e\u793a\u3057\u3066the_post()\u3092\u4f7f\u308f\u305a\u306b\u8868\u793a\u3059\u308b<\/span><\/div><button type=\"button\" class=\"copy-button wpq-copy-button\">\u30b3\u30d4\u30fc<\/button><\/div><pre data-wpq-code-region data-wpq-code-label=\"\u30b3\u30fc\u30c9\u4f8b: \u6295\u7a3fID\u3092\u660e\u793a\u3057\u3066the_post()\u3092\u4f7f\u308f\u305a\u306b\u8868\u793a\u3059\u308b \/ template-part.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-var\">$id_query<\/span> = <span class=\"c-keyword\">new<\/span> <span class=\"c-fn\">WP_Query<\/span>(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   [&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post_type&#039;<\/span>      =&gt; <span class=\"c-str\">&#039;post&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post_status&#039;<\/span>    =&gt; <span class=\"c-str\">&#039;publish&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;posts_per_page&#039;<\/span> =&gt; <span class=\"c-num\">3<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;fields&#039;<\/span>         =&gt; <span class=\"c-str\">&#039;ids&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;post__in&#039;<\/span>       =&gt; [ <span class=\"c-num\">61<\/span>, <span class=\"c-num\">62<\/span>, <span class=\"c-num\">63<\/span> ],&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;orderby&#039;<\/span>       =&gt; <span class=\"c-str\">&#039;post__in&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;ignore_sticky_posts&#039;<\/span> =&gt; <span class=\"c-keyword\">true<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   ]&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">);&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-keyword\">if<\/span> ( <span class=\"c-var\">$id_query<\/span>-&gt;posts ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;ul&gt;&#039;<\/span>;&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;   <span class=\"c-keyword\">foreach<\/span> ( <span class=\"c-var\">$id_query<\/span>-&gt;posts <span class=\"c-keyword\">as<\/span> <span class=\"c-var\">$post_id<\/span> ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      printf(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-str\">&#039;&lt;li&gt;&lt;a href=&quot;%1$s&quot;&gt;%2$s&lt;\/a&gt;&lt;\/li&gt;&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_url( get_permalink( <span class=\"c-var\">$post_id<\/span> ) ),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_html( get_the_title( <span class=\"c-var\">$post_id<\/span> ) )&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      );&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   }&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;   <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;\/ul&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">}&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\n$id_query = new WP_Query(&lt;br \/&gt;\n   [&lt;br \/&gt;\n      &#039;post_type&#039;      =&gt; &#039;post&#039;,&lt;br \/&gt;\n      &#039;post_status&#039;    =&gt; &#039;publish&#039;,&lt;br \/&gt;\n      &#039;posts_per_page&#039; =&gt; 3,&lt;br \/&gt;\n      &#039;fields&#039;         =&gt; &#039;ids&#039;,&lt;br \/&gt;\n      &#039;post__in&#039;       =&gt; [ 61, 62, 63 ],&lt;br \/&gt;\n      &#039;orderby&#039;       =&gt; &#039;post__in&#039;,&lt;br \/&gt;\n      &#039;ignore_sticky_posts&#039; =&gt; true,&lt;br \/&gt;\n   ]&lt;br \/&gt;\n);&lt;\/p&gt;\n&lt;p&gt;if ( $id_query-&gt;posts ) {&lt;br \/&gt;\n   echo &#039;&lt;ul&gt;&#039;;&lt;\/p&gt;\n&lt;p&gt;   foreach ( $id_query-&gt;posts as $post_id ) {&lt;br \/&gt;\n      printf(&lt;br \/&gt;\n         &#039;&lt;li&gt;&lt;a href=&quot;%1$s&quot;&gt;%2$s&lt;\/a&gt;&lt;\/li&gt;&#039;,&lt;br \/&gt;\n         esc_url( get_permalink( $post_id ) ),&lt;br \/&gt;\n         esc_html( get_the_title( $post_id ) )&lt;br \/&gt;\n      );&lt;br \/&gt;\n   }&lt;\/p&gt;\n&lt;p&gt;   echo &#039;&lt;\/ul&gt;&#039;;&lt;br \/&gt;\n}&lt;br \/&gt;<\/textarea><\/div>\n<p>\u3053\u306e\u4f8b\u306f`$id_query-&gt;the_post()`\u3084`setup_postdata()`\u3092\u547c\u3070\u306a\u3044\u305f\u3081\u3001`global $post`\u3092\u5207\u308a\u66ff\u3048\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u3053\u306e\u51e6\u7406\u3060\u3051\u3092\u7406\u7531\u306b`wp_reset_postdata()`\u3092\u547c\u3076\u5fc5\u8981\u3082\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001`the_title()`\u3001`the_content()`\u3001\u6295\u7a3fID\u3092\u7701\u7565\u3057\u305f`get_permalink()`\u306a\u3069\u3001\u30eb\u30fc\u30d7\u3067\u5207\u308a\u66ff\u3048\u305f\u6295\u7a3f\u3092\u4f7f\u3046\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u3078\u623b\u3059\u5834\u5408\u306f\u3001\u57fa\u672c\u306e\u30eb\u30fc\u30d7\u69cb\u9020\u3092\u4f7f\u3046\u65b9\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n\n<p>\u6295\u7a3fID\u3092\u4f7f\u3046\u65b9\u6cd5\u3068\u901a\u5e38\u306e\u30eb\u30fc\u30d7\u306e\u9055\u3044\u3092\u78ba\u8a8d\u3067\u304d\u305f\u3089\u3001\u6b21\u306f\u6295\u7a3f\u30bf\u30a4\u30d7\u3084\u4ef6\u6570\u3092\u3054\u81ea\u8eab\u306e\u4e00\u89a7\u306b\u5408\u308f\u305b\u307e\u3059\u3002WP Query Builder\u3067\u53d6\u5f97\u6761\u4ef6\u3092\u4f5c\u308a\u3001\u8868\u793a\u3059\u308b\u51e6\u7406\u306f\u3053\u306e\u8a18\u4e8b\u306e\u4f8b\u3068\u7d44\u307f\u5408\u308f\u305b\u307e\u3059\u3002<\/p>\n<section class=\"builder-cta wpq-builder-panel\"><div class=\"builder-icon\" aria-hidden=\"true\"><\/div><div class=\"wpq-builder-panel__copy\"><h3>\u4e00\u89a7\u306e\u53d6\u5f97\u6761\u4ef6\u3092\u7d44\u307f\u7acb\u3066\u308b<\/h3><p>\u6295\u7a3f\u30bf\u30a4\u30d7\u30fb\u7d5e\u308a\u8fbc\u307f\u30fb\u4ef6\u6570\u3092\u6574\u7406\u3057\u3001\u751f\u6210\u3057\u305f$args\u3092\u30eb\u30fc\u30d7\u3078\u6e21\u3057\u307e\u3059\u3002the_post()\u3092\u4f7f\u3046\u5834\u5408\u306f\u3001\u547c\u3073\u51fa\u3057\u4f4d\u7f6e\u3068\u6700\u5f8c\u306e\u30ea\u30bb\u30c3\u30c8\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p><\/div><div class=\"builder-actions wpq-builder-panel__actions\"><a class=\"button wpq-button wpq-button--primary\" href=\"https:\/\/wptoolslab.com\/query-builder\/\">WP Query Builder\u3067\u30af\u30a8\u30ea\u3092\u4f5c\u308b<\/a><\/div><\/section>\n\n<h2 id=\"reset\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"refresh\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\" \/>\n  <path d=\"M21 3v5h-5\" \/>\n  <path d=\"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\" \/>\n  <path d=\"M8 16H3v5\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u8ffd\u52a0\u30eb\u30fc\u30d7\u3092\u4f7f\u3063\u305f\u3042\u3068\u306fwp_reset_postdata()\u3067\u623b\u3059<\/span><\/h2>\n<p>\u8ffd\u52a0\u30af\u30a8\u30ea\u306e`the_post()`\u306f\u3001`global $post`\u3092\u30eb\u30fc\u30d7\u4e2d\u306e\u5404\u6295\u7a3f\u3078\u5207\u308a\u66ff\u3048\u307e\u3059\u3002\u30eb\u30fc\u30d7\u304c\u7d42\u308f\u3063\u305f\u76f4\u5f8c\u306b`wp_reset_postdata()`\u3092\u7f6e\u304d\u3001\u305d\u306e\u5f8c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u304c\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u3044\u3066\u3044\u308b\u8a18\u4e8b\u3092\u518d\u3073\u53c2\u7167\u3067\u304d\u308b\u72b6\u614b\u3078\u623b\u3057\u307e\u3059\u3002<\/p>\n<p>\u30ea\u30bb\u30c3\u30c8\u304c\u5fc5\u8981\u304b\u306f\u3001`WP_Query`\u3092\u4f5c\u3063\u305f\u304b\u3067\u306f\u306a\u304f\u3001`the_post()`\u3084`setup_postdata()`\u3067\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u5207\u308a\u66ff\u3048\u305f\u304b\u3067\u5224\u65ad\u3057\u307e\u3059\u3002\u623b\u3057\u5fd8\u308c\u3067\u5225\u30bf\u30a4\u30c8\u30eb\u304c\u51fa\u308b\u75c7\u72b6\u3084\u3001\u30ea\u30bb\u30c3\u30c8\u95a2\u6570\u306e\u9055\u3044\u3092\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u6b21\u306e\u8a18\u4e8b\u3082\u3042\u308f\u305b\u3066\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"wpq-related-links\"><a class=\"deep-link-card wpq-related-link wpq-related-link--internal\" href=\"https:\/\/wptoolslab.com\/query-lab\/articles\/wp-reset-postdata-reason\/\"><span class=\"article-thumb wpq-related-link__thumb\"><img decoding=\"async\" alt=\"wp_reset_postdata()\u304c\u5fc5\u8981\u306a\u7406\u7531\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/wp-reset-postdata-reason-card.png\" loading=\"lazy\" \/><\/span><div class=\"deep-link-copy wpq-related-link__copy\"><small>\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/small><b>wp_reset_postdata()\u304c\u5fc5\u8981\u306a\u7406\u7531<\/b><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080<\/span><\/span><\/div><\/a><a class=\"deep-link-card wpq-related-link wpq-related-link--internal\" href=\"https:\/\/wptoolslab.com\/query-lab\/articles\/wp-query-wrong-title-after-loop\/\"><span class=\"article-thumb wpq-related-link__thumb\"><img decoding=\"async\" alt=\"\u95a2\u9023\u8a18\u4e8b\u306e\u8ffd\u52a0\u5f8c\u306b\u8a18\u4e8b\u30bf\u30a4\u30c8\u30eb\u30fb\u672c\u6587\u304c\u5225\u306e\u8a18\u4e8b\u3078\u5909\u308f\u308b\u539f\u56e0\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/wp-query-wrong-title-after-loop-card-1.png\" loading=\"lazy\" \/><\/span><div class=\"deep-link-copy wpq-related-link__copy\"><small>\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/small><b>\u95a2\u9023\u8a18\u4e8b\u306e\u8ffd\u52a0\u5f8c\u306b\u8a18\u4e8b\u30bf\u30a4\u30c8\u30eb\u30fb\u672c\u6587\u304c\u5225\u306e\u8a18\u4e8b\u3078\u5909\u308f\u308b\u539f\u56e0<\/b><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080<\/span><\/span><\/div><\/a><\/div>\n<h2 id=\"verification\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"shield-check\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\" \/>\n  <path d=\"m9 12 2 2 4-4\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u540c\u30583\u4ef6\u3067\u6bd4\u3079\u308b\u3068\u3001\u547c\u3073\u51fa\u3057\u4f4d\u7f6e\u306b\u3088\u308b\u9055\u3044\u304c\u5206\u304b\u308b<\/span><\/h2>\n<p>3\u679a\u306e\u753b\u9762\u306e\u9055\u3044\u3092\u3001\u30eb\u30fc\u30d7\u306e\u4f4d\u7f6e\u3067\u3082\u6bd4\u3079\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u8868\u306e`current_post`\u306f\u8868\u793a\u3059\u308b\u6642\u70b9\u306e\u5024\u3067\u3001-1\u306f\u958b\u59cb\u524d\u30010\u30fb1\u30fb2\u306fA\u30fbB\u30fbC\u306b\u5f53\u305f\u308a\u307e\u3059\u3002\u7d42\u4e86\u5f8c\u306f`have_posts()`\u306b\u3088\u3063\u3066\u5dfb\u304d\u623b\u3055\u308c\u308b\u305f\u3081\u3001\u30eb\u30fc\u30d7\u306e\u5916\u3067\u8a18\u9332\u3057\u305f\u5024\u3068\u306f\u533a\u5225\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5024\u306f\u4e0a\u306e\u753b\u50cf\u3068\u540c\u3058\u3001\u30ed\u30fc\u30ab\u30eb\u306eWordPress 7.1\uff0fPHP 8.4.20\u3067\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"wpq-table-block\"><p class=\"wpq-table-hint\" aria-hidden=\"true\">\u8868\u306f\u6a2a\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u304d\u307e\u3059<\/p><div class=\"cause-table table-scroll wpq-table-wrap\" role=\"region\" tabindex=\"0\" aria-label=\"\u8868: \u6761\u4ef6 \/ \u8868\u793a\u6642\u306ecurrent_post \/ global $post \/ get_the_ID()\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u6761\u4ef6<\/th><th>\u8868\u793a\u6642\u306ecurrent_post<\/th><th>global $post \/ get_the_ID()<\/th><th>\u8868\u793a\u5bfe\u8c61<\/th><\/tr><\/thead><tbody><tr><td>\u958b\u59cb\u524d<\/td><td>-1<\/td><td>64 \/ 64<\/td><td>\u5143\u306e\u78ba\u8a8d\u30da\u30fc\u30b8<\/td><\/tr><tr><td>while\u76f4\u5f8c\u306bthe_post()<\/td><td>0\u30011\u30012<\/td><td>61\u300162\u300163\u3067\u4e00\u81f4<\/td><td>\u78ba\u8a8d\u7528\u8a18\u4e8bA\u3001B\u3001C<\/td><\/tr><tr><td>the_post()\u306a\u3057\u30673\u56de\u78ba\u8a8d<\/td><td>-1\u306e\u307e\u307e<\/td><td>3\u56de\u3068\u308264<\/td><td>3\u56de\u3068\u3082\u5143\u306e\u78ba\u8a8d\u30da\u30fc\u30b8<\/td><\/tr><tr><td>while\u524d\u306b\u30821\u56de\u547c\u3076<\/td><td>1\u30012<\/td><td>62\u300163<\/td><td>\u78ba\u8a8d\u7528\u8a18\u4e8bB\u3001C<\/td><\/tr><tr><td>\u8868\u793a\u5f8c\u306b\u547c\u3076<\/td><td>-1\u30010\u30011<\/td><td>64\u300161\u300162<\/td><td>\u5143\u306e\u78ba\u8a8d\u30da\u30fc\u30b8\u3001\u78ba\u8a8d\u7528\u8a18\u4e8bA\u3001B\u3002C\u306f\u672a\u8868\u793a<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u6295\u7a3f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092`get_the_title( $item )`\u3084`get_the_content( null, false, $item )`\u3078\u6e21\u3059\u5834\u5408\u306f\u3001\u5bfe\u8c61\u306e\u6295\u7a3f\u3092\u660e\u793a\u3057\u3066\u5024\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u6295\u7a3f\u3092\u6307\u5b9a\u3057\u3066\u5024\u3092\u53d6\u308b\u65b9\u6cd5\u3068\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u7528\u306e\u8868\u793a\u5bfe\u8c61\u3092\u5207\u308a\u66ff\u3048\u308b\u65b9\u6cd5\u306f\u5206\u3051\u3066\u8003\u3048\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001`get_the_content()`\u306f\u6295\u7a3f\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u308c\u3060\u3051\u3067\u306f`the_content()`\u3068\u540c\u3058\u30d5\u30a3\u30eb\u30bf\u30fc\u51e6\u7406\u3092\u884c\u3044\u307e\u305b\u3093\u3002\u516c\u958b\u753b\u9762\u3067\u672c\u6587\u3092\u901a\u5e38\u3069\u304a\u308a\u8868\u793a\u3059\u308b\u5834\u5408\u306f\u3001\u30eb\u30fc\u30d7\u5185\u3067`the_post()`\u306e\u5f8c\u306b`the_content()`\u3092\u4f7f\u3046\u5f62\u3092\u57fa\u672c\u306b\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"debug\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"binder-check\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <rect width=\"8\" height=\"4\" x=\"8\" y=\"2\" rx=\"1\" ry=\"1\" \/>\n  <path d=\"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2\" \/>\n  <path d=\"m9 14 2 2 4-4\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u8868\u793a\u304c\u305a\u308c\u308b\u3068\u304d\u306f\u3001\u30eb\u30fc\u30d7\u4f4d\u7f6e\u3068\u6295\u7a3fID\u3092\u6bd4\u3079\u308b<\/span><\/h2>\n<p>\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u3092\u898b\u6bd4\u3079\u308b\u3068\u3001\u540c\u540d\u6295\u7a3f\u30841\u4ef6\u9045\u308c\u3092\u898b\u843d\u3068\u3059\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306e\u30b3\u30fc\u30c9\u3092\u7f6e\u3044\u305f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d1\u30fc\u30c4\u3067\u3001`$list_query-&gt;the_post()`\u306e\u76f4\u5f8c\u306b\u6b21\u306e\u30ed\u30b0\u3092\u4e00\u6642\u7684\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30eb\u30fc\u30d7\u4f4d\u7f6e\u30683\u7a2e\u985e\u306e\u6295\u7a3fID\u306b\u52a0\u3048\u3001\u30bf\u30a4\u30c8\u30eb\u3082\u8a18\u9332\u3057\u307e\u3059\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"code-head wpq-code-head\"><div class=\"code-meta wpq-code-meta\"><span class=\"code-lang wpq-code-pill wpq-code-pill--lang\">PHP<\/span><span class=\"code-filename wpq-code-pill\">template-part.php<\/span><span class=\"code-purpose wpq-code-pill\">\u30eb\u30fc\u30d7\u4f4d\u7f6e\u3068\u6295\u7a3f\u53c2\u7167\u3092\u30ed\u30fc\u30ab\u30eb\u30ed\u30b0\u3078\u8a18\u9332\u3059\u308b<\/span><\/div><button type=\"button\" class=\"copy-button wpq-copy-button\">\u30b3\u30d4\u30fc<\/button><\/div><pre data-wpq-code-region data-wpq-code-label=\"\u30b3\u30fc\u30c9\u4f8b: \u30eb\u30fc\u30d7\u4f4d\u7f6e\u3068\u6295\u7a3f\u53c2\u7167\u3092\u30ed\u30fc\u30ab\u30eb\u30ed\u30b0\u3078\u8a18\u9332\u3059\u308b \/ template-part.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-keyword\">global<\/span> <span class=\"c-var\">$post<\/span>;&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;error_log(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   wp_json_encode(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      [&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-key\">&#039;current_post&#039;<\/span>  =&gt; <span class=\"c-var\">$list_query<\/span>-&gt;current_post,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-key\">&#039;query_post_id&#039;<\/span> =&gt; <span class=\"c-var\">$list_query<\/span>-&gt;post <span class=\"c-keyword\">instanceof<\/span> WP_Post&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            ? <span class=\"c-var\">$list_query<\/span>-&gt;post-&gt;ID&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            : <span class=\"c-keyword\">null<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-key\">&#039;global_post_id&#039;<\/span>=&gt; <span class=\"c-var\">$post<\/span> <span class=\"c-keyword\">instanceof<\/span> WP_Post ? <span class=\"c-var\">$post<\/span>-&gt;ID : <span class=\"c-keyword\">null<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-key\">&#039;get_the_ID&#039;<\/span>    =&gt; get_the_ID(),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-key\">&#039;title&#039;<\/span>         =&gt; get_the_title(),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      ],&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      JSON_UNESCAPED_UNICODE&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   )&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">);&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\nglobal $post;&lt;\/p&gt;\n&lt;p&gt;error_log(&lt;br \/&gt;\n   wp_json_encode(&lt;br \/&gt;\n      [&lt;br \/&gt;\n         &#039;current_post&#039;  =&gt; $list_query-&gt;current_post,&lt;br \/&gt;\n         &#039;query_post_id&#039; =&gt; $list_query-&gt;post instanceof WP_Post&lt;br \/&gt;\n            ? $list_query-&gt;post-&gt;ID&lt;br \/&gt;\n            : null,&lt;br \/&gt;\n         &#039;global_post_id&#039;=&gt; $post instanceof WP_Post ? $post-&gt;ID : null,&lt;br \/&gt;\n         &#039;get_the_ID&#039;    =&gt; get_the_ID(),&lt;br \/&gt;\n         &#039;title&#039;         =&gt; get_the_title(),&lt;br \/&gt;\n      ],&lt;br \/&gt;\n      JSON_UNESCAPED_UNICODE&lt;br \/&gt;\n   )&lt;br \/&gt;\n);&lt;br \/&gt;<\/textarea><\/div>\n<p>`wp-config.php`\u3067`WP_DEBUG`\u3068`WP_DEBUG_LOG`\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u901a\u5e38\u306fWordPress\u306e`wp-content\/debug.log`\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u753b\u9762\u306b\u30ed\u30b0\u3092\u51fa\u3055\u306a\u3044\u305f\u3081\u3001`WP_DEBUG_DISPLAY`\u306f`false`\u306b\u3057\u307e\u3059\u3002\u78ba\u8a8d\u7528\u306e\u30ed\u30b0\u306f\u30ed\u30fc\u30ab\u30eb\u3084\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u74b0\u5883\u3060\u3051\u3067\u4f7f\u3044\u3001\u539f\u56e0\u304c\u5206\u304b\u3063\u305f\u3089\u524a\u9664\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b63\u5e38\u306a\u3089\u3001`query_post_id`\u3001`global_post_id`\u3001`get_the_ID()`\u304c\u5404\u5468\u3067\u540c\u3058ID\u306b\u306a\u308a\u3001`current_post`\u304c0\u304b\u30891\u305a\u3064\u5897\u3048\u307e\u3059\u3002<\/p>\n<h2 id=\"official-docs\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">have_posts()\u3068the_post()\u306e\u516c\u5f0f\u8cc7\u6599<\/span><\/h2>\n<p>`have_posts()`\u304c\u78ba\u8a8d\u3059\u308b\u5185\u5bb9\u3001`the_post()`\u304c\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u6e96\u5099\u3059\u308b\u9806\u5e8f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u53c2\u7167\u5148\u3068\u30eb\u30fc\u30d7\u5f8c\u306e\u623b\u3057\u65b9\u306f\u3001\u6b21\u306e\u516c\u5f0f\u8cc7\u6599\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<section class=\"official-docs-card wpq-reference-card wpq-reference-card--official\"><div class=\"official-docs-head\"><span class=\"official-docs-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"book\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M12 5v16\" \/>\n  <path d=\"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z\" \/>\n<\/svg><\/span><div><p class=\"eyebrow wpq-eyebrow\">WordPress\u516c\u5f0f<\/p><h2>\u78ba\u8a8d\u306b\u4f7f\u3063\u305fWordPress\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h2><\/div><\/div><ul class=\"wpq-reference-list\"><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/the_post\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Query\u306ethe_post()<\/strong><span class=\"wpq-reference-item__description\">\u6b21\u306e\u6295\u7a3f\u3078\u306e\u79fb\u52d5\u3068\u6295\u7a3f\u30c7\u30fc\u30bf\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/have_posts\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Query\u306ehave_posts()<\/strong><span class=\"wpq-reference-item__description\">\u6295\u7a3f\u306e\u6709\u7121\u78ba\u8a8d\u3068\u30eb\u30fc\u30d7\u7d42\u4e86\u6642\u306e\u51e6\u7406\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Query<\/strong><span class=\"wpq-reference-item__description\">\u57fa\u672c\u306e\u30eb\u30fc\u30d7\u3001global $post\u3001\u30ea\u30bb\u30c3\u30c8\u4f4d\u7f6e\u3092\u307e\u3068\u3081\u3066\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/the_post\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">the_post()<\/strong><span class=\"wpq-reference-item__description\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u7528\u95a2\u6570\u304cglobal $wp_query\u3092\u547c\u3076\u5b9f\u88c5\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/get_the_ID\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">get_the_ID()<\/strong><span class=\"wpq-reference-item__description\">\u30eb\u30fc\u30d7\u3067\u6e96\u5099\u3055\u308c\u305f\u6295\u7a3f\u306eID\u3092\u53d6\u5f97\u3059\u308b\u4ed5\u69d8\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/the_title\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">the_title()<\/strong><span class=\"wpq-reference-item__description\">\u30eb\u30fc\u30d7\u3067\u6e96\u5099\u3055\u308c\u305f\u6295\u7a3f\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3059\u308b\u4ed5\u69d8\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/the_content\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">the_content()<\/strong><span class=\"wpq-reference-item__description\">\u30eb\u30fc\u30d7\u3067\u6e96\u5099\u3055\u308c\u305f\u6295\u7a3f\u306e\u672c\u6587\u3068the_content\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/themes\/classic-themes\/basics\/the-loop\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">The Loop<\/strong><span class=\"wpq-reference-item__description\">have_posts()\u3001the_post()\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u57fa\u672c\u306e\u9806\u756a\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">wp_reset_postdata()<\/strong><span class=\"wpq-reference-item__description\">\u8ffd\u52a0\u30eb\u30fc\u30d7\u5f8c\u306b\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u958b\u3044\u3066\u3044\u308b\u8a18\u4e8b\u3078\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3059\u65b9\u6cd5\u3092\u78ba\u8a8d\u3057\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><li class=\"wpq-reference-item\"><a class=\"wpq-reference-item__link\" href=\"https:\/\/developer.wordpress.org\/advanced-administration\/debug\/debug-wordpress\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WordPress\u306e\u30c7\u30d0\u30c3\u30b0<\/strong><span class=\"wpq-reference-item__description\">WP_DEBUG_LOG\u3068debug.log\u3092\u4f7f\u3063\u305f\u78ba\u8a8d\u65b9\u6cd5\u3092\u8abf\u3079\u305f\u3044\u6642<\/span><\/span><span class=\"wpq-reference-item__hint\" aria-hidden=\"true\"><svg data-wpq-icon=\"external\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M15 3h6v6\" \/>\n  <path d=\"M10 14 21 3\" \/>\n  <path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" \/>\n<\/svg><\/span><\/a><\/li><\/ul><\/section>\n<h2 id=\"summary\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"check\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M20 6 9 17l-5-5\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u3092\u9806\u756a\u306b\u8868\u793a\u3067\u304d\u305f\u304b\u78ba\u304b\u3081\u308b<\/span><\/h2>\n<p>\u6700\u521d\u306e\u8a18\u4e8b\u304b\u3089\u6700\u5f8c\u306e\u8a18\u4e8b\u307e\u3067\u3001\u629c\u3051\u3084\u7e70\u308a\u8fd4\u3057\u306a\u304f\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u304b\u3092\u898b\u307e\u3059\u3002\u4e00\u89a7\u306e\u5f8c\u306b\u3042\u308b\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u3082\u5143\u306e\u8a18\u4e8b\u306e\u307e\u307e\u306a\u3089\u3001\u6700\u5f8c\u306e\u30ea\u30bb\u30c3\u30c8\u307e\u3067\u78ba\u8a8d\u3067\u304d\u3066\u3044\u307e\u3059\u3002<\/p>\n<section class=\"final-checklist wpq-checklist-card wpq-checklist-card--final\"><div class=\"final-checklist-head\"><span class=\"final-checklist-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"check\" aria-hidden=\"true\" focusable=\"false\" class=\"wpq-icon-svg\"\n  xmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n \n \n  viewBox=\"0 0 24 24\"\n  fill=\"none\"\n  stroke=\"currentColor\"\n  stroke-width=\"2\"\n  stroke-linecap=\"round\"\n  stroke-linejoin=\"round\"\n>\n  <path d=\"M20 6 9 17l-5-5\" \/>\n<\/svg><\/span><h2>the_post()\u306e\u6700\u7d42\u78ba\u8a8d<\/h2><\/div><ul class=\"wpq-checklist\"><li>have_posts()\u3068the_post()\u306e\u5f79\u5272\u3092\u5206\u3051\u305f<\/li><li>\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u3067\u306f\u540c\u3058\u30af\u30a8\u30ea\u5909\u6570\u306ethe_post()\u3092\u4f7f\u3063\u305f<\/li><li>while\u76f4\u5f8c\u30fb\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u524d\u306b1\u56de\u3060\u3051\u7f6e\u3044\u305f<\/li><li>global $post\u3001get_the_ID()\u3001\u30af\u30a8\u30ea\u306e\u6295\u7a3fID\u304c\u5404\u5468\u3067\u4e00\u81f4\u3057\u305f<\/li><li>\u8ffd\u52a0\u30eb\u30fc\u30d7\u5f8c\u306bwp_reset_postdata()\u3092\u66f8\u3044\u305f<\/li><\/ul><\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u95a2\u9023\u8a18\u4e8b\u3084\u65b0\u7740\u8a18\u4e8b\u3092WP_Query\u3067\u8ffd\u52a0\u3059\u308b\u3068\u304d\u306b\u3001the_post()\u3092\u3069\u3053\u3078\u66f8\u304f\u304b\u3001have_posts()\u3068\u4f55\u304c\u9055\u3046\u304b\u3001\u547c\u3076\u4f4d\u7f6e\u3067\u8868\u793a\u304c\u3069\u3046\u5909\u308f\u308b\u304b\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":3,"featured_media":4099,"template":"","meta":{"wpq_kicker":"WP_Query\u57fa\u790e","wpq_lead":"\u95a2\u9023\u8a18\u4e8b\u3084\u65b0\u7740\u8a18\u4e8b\u3092WP_Query\u3067\u8ffd\u52a0\u3059\u308b\u3068\u304d\u306f\u3001\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u30921\u4ef6\u305a\u3064\u8868\u793a\u3067\u304d\u308b\u72b6\u614b\u3078\u5207\u308a\u66ff\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002have_posts()\u3067\u6b21\u306e\u6295\u7a3f\u3092\u78ba\u304b\u3081\u3001\u30bf\u30a4\u30c8\u30eb\u3084\u672c\u6587\u3092\u51fa\u3059\u524d\u306bthe_post()\u3092\u547c\u3076\u6d41\u308c\u3092\u3001\u753b\u9762\u4f8b\u3068\u30b3\u30fc\u30c9\u3067\u78ba\u8a8d\u3057\u307e\u3059\u3002","wpq_hero_title_line1":"","wpq_hero_title_line2":"","wpq_hero_title_accent":"","wpq_hero_thumbnail_alt":"WordPress\u3067\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u306b\u30bf\u30a4\u30c8\u30eb\u30fb\u672c\u6587\u3092\u6b63\u3057\u304f\u8868\u793a\u3059\u308b\u65b9\u6cd5\uff5cthe_post()\u306e\u4f7f\u3044\u65b9\u3068\u5f79\u5272 \u306e\u30d2\u30fc\u30ed\u30fc\u30b5\u30e0\u30cd\u30a4\u30eb","wpq_hero_summary_mode":"","wpq_hero_summary_label":"\u8ffd\u52a0\u3057\u305f\u4e00\u89a7\u306e\u8868\u793a\u9806","wpq_hero_summary_items":"`have_posts()`::\u6b21\u306e\u6295\u7a3f\u304c\u3042\u308b\u304b\u78ba\u304b\u3081\u308b\n`the_post()`::\u8868\u793a\u3059\u308b\u6295\u7a3f\u3078\u5207\u308a\u66ff\u3048\u308b","wpq_reading_time":"","wpq_difficulty_label":"","wpq_difficulty_stars":"2","wpq_target_audience":"\u95a2\u9023\u8a18\u4e8b\u3084\u65b0\u7740\u8a18\u4e8b\u306e\u4e00\u89a7\u3092WP_Query\u3067\u8ffd\u52a0\u3057\u305f\u304c\u3001the_post()\u306e\u5f79\u5272\u304c\u5206\u304b\u3089\u305a\u3001\u3069\u3053\u3078\u66f8\u304f\u306e\u304b\u3001have_posts()\u3068\u4f55\u304c\u9055\u3046\u306e\u304b\u3092\u77e5\u308a\u305f\u3044WordPress\u521d\u7d1a\u301c\u4e2d\u7d1a\u8005","wpq_updated_label":"","wpq_summary_items":"","wpq_scope_include":"","wpq_scope_exclude":"","wpq_quick_checks":"","wpq_sidebar_notes":"","wpq_sidebar_promo_text":"","wpq_sidebar_promo_label":"","wpq_sidebar_promo_url":"","wpq_builder_fields":"","wpq_official_links":"WP_Query\u306ethe_post()|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/the_post\/\nWP_Query\u306ehave_posts()|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/have_posts\/\nWP_Query|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\nthe_post()|https:\/\/developer.wordpress.org\/reference\/functions\/the_post\/\nget_the_ID()|https:\/\/developer.wordpress.org\/reference\/functions\/get_the_ID\/\nthe_title()|https:\/\/developer.wordpress.org\/reference\/functions\/the_title\/\nthe_content()|https:\/\/developer.wordpress.org\/reference\/functions\/the_content\/\nThe Loop|https:\/\/developer.wordpress.org\/themes\/classic-themes\/basics\/the-loop\/\nwp_reset_postdata()|https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/\nWordPress\u306e\u30c7\u30d0\u30c3\u30b0|https:\/\/developer.wordpress.org\/advanced-administration\/debug\/debug-wordpress\/","wpq_pr_notice":"","wpq_affiliate_placement":"inline","wpq_affiliate_program":"xserver","wpq_affiliate_context":"test-environment","wpq_support_mode":"","wpq_popularity_score":"","wpq_author_box_name":"","wpq_author_box_role":"","wpq_author_box_body":"","wpq_author_box_avatar":"","wpq_author_box_avatar_url":"","wpq_author_avatar_url":"","wpq_reader_avatar_url":"","wpq_editor_avatar_url":"","footnotes":""},"categories":[17],"tags":[134,135,133,100],"wpq_card_label":[3,4],"wpq_difficulty":[11],"class_list":["post-4064","wpq_article","type-wpq_article","status-publish","has-post-thumbnail","hentry","category-basic","tag-have_posts","tag-the-loop-2","tag-the_post","tag-100"],"_links":{"self":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/4064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article"}],"about":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/types\/wpq_article"}],"author":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":1,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/4064\/revisions"}],"predecessor-version":[{"id":4227,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/4064\/revisions\/4227"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media\/4099"}],"wp:attachment":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media?parent=4064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/categories?post=4064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/tags?post=4064"},{"taxonomy":"wpq_card_label","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_card_label?post=4064"},{"taxonomy":"wpq_difficulty","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_difficulty?post=4064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}