{"id":3893,"date":"2026-08-28T14:40:47","date_gmt":"2026-08-28T05:40:47","guid":{"rendered":"https:\/\/wptoolslab.com\/query-lab\/?post_type=wpq_article&#038;p=3893"},"modified":"2026-09-12T19:45:30","modified_gmt":"2026-09-12T10:45:30","slug":"query-posts-avoid","status":"publish","type":"wpq_article","link":"https:\/\/wptoolslab.com\/query-lab\/articles\/query-posts-avoid\/","title":{"rendered":"query_posts\u3092\u4f7f\u308f\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u7406\u7531\uff5cWP_Query\u30fbpre_get_posts\u3068\u306e\u9055\u3044"},"content":{"rendered":"<section class=\"conclusion wpq-conclusion\"><h2 class=\"wpq-conclusion__title\">query_posts\u3092\u898b\u3064\u3051\u305f\u3089\u3001\u7528\u9014\u306b\u5408\u3046\u65b9\u6cd5\u3078\u7f6e\u304d\u63db\u3048\u308b<\/h2><p>`query_posts()`\u306f\u3001\u5225\u306e\u6295\u7a3f\u4e00\u89a7\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u666e\u901a\u306e\u53d6\u5f97\u95a2\u6570\u3067\u306f\u306a\u304f\u3001\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u304c\u53c2\u7167\u3059\u308b\u30b0\u30ed\u30fc\u30d0\u30eb\u306a\u30af\u30a8\u30ea\u3092\u5225\u306e\u30af\u30a8\u30ea\u3078\u5dee\u3057\u66ff\u3048\u308b\u95a2\u6570\u3067\u3059\u3002WordPress\u516c\u5f0f\u3082\u3001\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u306f\u3067\u304d\u308b\u9650\u308a\u907f\u3051\u308b\u3088\u3046\u6848\u5185\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6295\u7a3f\u4e00\u89a7\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u308b\u306a\u3089`pre_get_posts`\u3001\u8a18\u4e8b\u4e0b\u306a\u3069\u306b\u5225\u4e00\u89a7\u3092\u8db3\u3059\u306a\u3089`WP_Query`\u307e\u305f\u306f`get_posts()`\u304c\u57fa\u672c\u3067\u3059\u3002\u307e\u305a\u53e4\u3044\u30b3\u30fc\u30c9\u304c\u3069\u3061\u3089\u3092\u5909\u3048\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3057\u3001\u7528\u9014\u306b\u5408\u3046\u65b9\u6cd5\u3078\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<\/section>\n<h2 id=\"why-avoid-query-posts\" 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\">\u307e\u305a\u3001\u3069\u306e\u4e00\u89a7\u3092\u5909\u3048\u308b\u30b3\u30fc\u30c9\u304b\u78ba\u8a8d\u3059\u308b<\/span><\/h2>\n<p>\u53e4\u3044\u30c6\u30fc\u30de\u3084\u691c\u7d22\u3067\u898b\u3064\u3051\u305f\u30b3\u30fc\u30c9\u3067\u306f\u3001\u4e00\u89a7\u4ef6\u6570\u3092\u5909\u3048\u308b\u305f\u3081\u306b`query_posts()`\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306b\u3001\u305d\u306e\u30b3\u30fc\u30c9\u304c\u6295\u7a3f\u4e00\u89a7\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u3066\u3044\u308b\u306e\u304b\u3001\u8a18\u4e8b\u4e0b\u3084\u30b5\u30a4\u30c9\u30d0\u30fc\u306b\u5225\u4e00\u89a7\u3092\u8db3\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306f\u3001`query_posts()`\u304c\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5b8c\u5168\u306b\u4e0a\u66f8\u304d\u3059\u308b\u305f\u3081\u3001\u30c6\u30fc\u30de\u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u306f\u907f\u3051\u308b\u3088\u3046\u6848\u5185\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: \u554f\u984c\u306b\u306a\u308a\u3084\u3059\u3044\u70b9 \/ \u4f55\u304c\u8d77\u304d\u308b\u304b \/ \u4ee3\u308f\u308a\u306b\u8003\u3048\u308b\u3082\u306e\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u554f\u984c\u306b\u306a\u308a\u3084\u3059\u3044\u70b9<\/th><th>\u4f55\u304c\u8d77\u304d\u308b\u304b<\/th><th>\u4ee3\u308f\u308a\u306b\u8003\u3048\u308b\u3082\u306e<\/th><\/tr><\/thead><tbody><tr><td>\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u7f6e\u304d\u63db\u3048\u308b<\/td><td>\u73fe\u5728\u306e\u30da\u30fc\u30b8\u7528\u306b\u7528\u610f\u3055\u308c\u305f\u53d6\u5f97\u6761\u4ef6\u3092\u5f8c\u304b\u3089\u5dee\u3057\u66ff\u3048\u3066\u3057\u307e\u3046<\/td><td>pre_get_posts<\/td><\/tr><tr><td>\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u304c\u5d29\u308c\u3084\u3059\u3044<\/td><td>paged\u306a\u3069\u3092\u81ea\u5206\u3067\u8003\u616e\u3057\u306a\u3044\u3068\u30da\u30fc\u30b8\u9001\u308a\u304c\u5408\u308f\u306a\u3044<\/td><td>pre_get_posts<\/td><\/tr><tr><td>\u8ffd\u52a0\u306eSQL\u304c\u767a\u751f\u3057\u3084\u3059\u3044<\/td><td>\u3059\u3067\u306b\u53d6\u5f97\u3055\u308c\u305f\u7d50\u679c\u3092\u6368\u3066\u3066\u3001\u3082\u3046\u4e00\u5ea6\u53d6\u5f97\u3059\u308b\u5f62\u306b\u306a\u308a\u3084\u3059\u3044<\/td><td>pre_get_posts<\/td><\/tr><tr><td>\u5225\u4e00\u89a7\u3068\u306e\u533a\u5225\u304c\u3064\u304d\u306b\u304f\u3044<\/td><td>\u30e1\u30a4\u30f3\u4e00\u89a7\u306a\u306e\u304b\u8ffd\u52a0\u4e00\u89a7\u306a\u306e\u304b\u30b3\u30fc\u30c9\u304b\u3089\u8aad\u307f\u3065\u3089\u3044<\/td><td>WP_Query \/ get_posts<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u5148\u306b\u3001\u73fe\u5728\u306e\u30da\u30fc\u30b8\u306e\u4e00\u89a7\u3092\u5909\u3048\u305f\u3044\u306e\u304b\u3001\u5225\u67a0\u306e\u4e00\u89a7\u3092\u8db3\u3057\u305f\u3044\u306e\u304b\u3092\u5206\u3051\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">\u6295\u7a3f\u4e00\u89a7\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u8868\u793a\u4ef6\u6570\u3092\u5909\u3048\u308b\u306a\u3089\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3001\u8a18\u4e8b\u4e0b\u306b\u65b0\u77403\u4ef6\u3092\u8db3\u3059\u306a\u3089\u5225\u30af\u30a8\u30ea\u3067\u3059\u3002\u540c\u3058\u300c\u4e00\u89a7\u300d\u3067\u3082\u3001\u7f6e\u304d\u63db\u3048\u5148\u306f\u3053\u3053\u3067\u6c7a\u307e\u308a\u307e\u3059\u3002<\/span>\n<span class=\"wpq-marker wpq-marker--yellow\">`query_posts()`\u306e\u554f\u984c\u306f\u3001\u6295\u7a3f\u3092\u53d6\u5f97\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3067\u306f\u306a\u304f\u3001WordPress\u304c\u6301\u3063\u3066\u3044\u308b\u73fe\u5728\u306e\u30da\u30fc\u30b8\u306e\u6587\u8108\u3092\u5f8c\u304b\u3089\u7f6e\u304d\u63db\u3048\u3066\u3057\u307e\u3046\u70b9\u3067\u3059\u3002<\/span>\n<h2 id=\"main-query-problem\" 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\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5f8c\u304b\u3089\u5dee\u3057\u66ff\u3048\u308b\u3068\u5206\u304b\u308a\u306b\u304f\u304f\u306a\u308b<\/span><\/h2>\n<p>\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u8ffd\u52a0\u306eWP_Query\u306e\u9055\u3044\u306f[WP_Query\u306e\u5f79\u5272\u3068\u4f7f\u3044\u65b9](..\/wp-query-basics\/)\u3067\u5148\u306b\u6574\u7406\u3067\u304d\u307e\u3059\u3002\u5225\u30eb\u30fc\u30d7\u3092\u4f5c\u3063\u305f\u5f8c\u306e\u5f8c\u51e6\u7406\u306f[wp_reset_postdata()\u304c\u5fc5\u8981\u306a\u7406\u7531](..\/wp-reset-postdata-reason\/)\u3078\u7d9a\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>WordPress\u306fURL\u3001\u8868\u793a\u8a2d\u5b9a\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u3001\u691c\u7d22\u8a9e\u306a\u3069\u304b\u3089\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5148\u306b\u4f5c\u308a\u307e\u3059\u3002`query_posts()`\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u307e\u3067\u6765\u3066\u304b\u3089\u305d\u308c\u3092\u7f6e\u304d\u63db\u3048\u308b\u305f\u3081\u3001\u5143\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u6761\u4ef6\u3084\u30da\u30fc\u30b8\u306e\u6587\u8108\u304c\u8ffd\u3044\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306f\u53e4\u3044`home.php`\u306e\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u524d\u3067\u898b\u304b\u3051\u308b\u5f62\u3067\u3059\u3002\u6295\u7a3f\u4e00\u89a7\u306e\u4ef6\u6570\u3092\u5909\u3048\u308b\u610f\u56f3\u3067\u3082\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089\u53c2\u7167\u5148\u306e\u30af\u30a8\u30ea\u3092\u7f6e\u304d\u63db\u3048\u3066\u3044\u307e\u3059\u3002\u907f\u3051\u305f\u3044\u4f8b\u3068\u3057\u3066\u793a\u3059\u3082\u306e\u3067\u3001\u65b0\u3057\u304f\u8cbc\u3063\u3066\u4f7f\u3046\u30b3\u30fc\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\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\">home.php<\/span><span class=\"code-purpose wpq-code-pill\">\u63a1\u7528\u3057\u306a\u3044\u4f8b\uff1aquery_posts\u3067\u6295\u7a3f\u4e00\u89a7\u306e\u30af\u30a8\u30ea\u3092\u5f8c\u304b\u3089\u5dee\u3057\u66ff\u3048\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: \u63a1\u7528\u3057\u306a\u3044\u4f8b\uff1aquery_posts\u3067\u6295\u7a3f\u4e00\u89a7\u306e\u30af\u30a8\u30ea\u3092\u5f8c\u304b\u3089\u5dee\u3057\u66ff\u3048\u308b \/ home.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">&lt;?php&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">query_posts( [&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-key\">&#039;posts_per_page&#039;<\/span> =&gt; <span class=\"c-num\">5<\/span>,&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> ( have_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\">while<\/span> ( have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      the_post();&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;      printf(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-str\">&#039;&lt;li&gt;&lt;a href=&quot;%s&quot;&gt;%s&lt;\/a&gt;\uff08ID: %d\uff09&lt;\/li&gt;&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_url( get_permalink() ),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_html( get_the_title() ),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         get_the_ID()&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;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;wp_reset_query();&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\n&lt;?php&lt;br \/&gt;\nquery_posts( [&lt;br \/&gt;\n   &#039;posts_per_page&#039; =&gt; 5,&lt;br \/&gt;\n] );&lt;\/p&gt;\n&lt;p&gt;if ( have_posts() ) {&lt;br \/&gt;\n   echo &#039;&lt;ul&gt;&#039;;&lt;\/p&gt;\n&lt;p&gt;   while ( have_posts() ) {&lt;br \/&gt;\n      the_post();&lt;\/p&gt;\n&lt;p&gt;      printf(&lt;br \/&gt;\n         &#039;&lt;li&gt;&lt;a href=&quot;%s&quot;&gt;%s&lt;\/a&gt;\uff08ID: %d\uff09&lt;\/li&gt;&#039;,&lt;br \/&gt;\n         esc_url( get_permalink() ),&lt;br \/&gt;\n         esc_html( get_the_title() ),&lt;br \/&gt;\n         get_the_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;\/p&gt;\n&lt;p&gt;wp_reset_query();&lt;br \/&gt;<\/textarea><\/div>\n<p>\u6700\u5f8c\u306b`wp_reset_query()`\u3092\u66f8\u3044\u3066\u3082\u3001\u65e2\u306b\u5b9f\u884c\u3055\u308c\u305f\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u306f\u5225\u306b\u518d\u53d6\u5f97\u3057\u3001\u7f6e\u304d\u63db\u3048\u308b\u69cb\u9020\u306f\u5909\u308f\u308a\u307e\u305b\u3093\u3002\u30da\u30fc\u30b8\u9001\u308a\u3067\u306f`paged`\u3082\u8003\u616e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u5185\u90e8\u3067\u306f\u30b0\u30ed\u30fc\u30d0\u30eb\u306a`$wp_query`\u304c\u5dee\u3057\u66ff\u308f\u308a\u3001\u5143\u306e\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u306f`$wp_the_query`\u306b\u6b8b\u308a\u307e\u3059\u3002`wp_reset_query()`\u306f\u53c2\u7167\u5148\u3092\u5143\u3078\u623b\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u524d\u306b\u8868\u793a\u3057\u305f\u4e00\u89a7\u3084\u3001\u5931\u308f\u308c\u305f\u30da\u30fc\u30b8\u756a\u53f7\u3092\u3055\u304b\u306e\u307c\u3063\u3066\u76f4\u3059\u3082\u306e\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5358\u306b\u30ea\u30bb\u30c3\u30c8\u95a2\u6570\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u306f\u3001\u7f6e\u304d\u63db\u3048\u306e\u89e3\u6c7a\u306b\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2 id=\"use-pre-get-posts\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"list\" 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 5h.01\" \/>\n  <path d=\"M3 12h.01\" \/>\n  <path d=\"M3 19h.01\" \/>\n  <path d=\"M8 5h13\" \/>\n  <path d=\"M8 12h13\" \/>\n  <path d=\"M8 19h13\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5909\u3048\u305f\u3044\u306a\u3089pre_get_posts\u3092\u4f7f\u3046<\/span><\/h2>\n<p>\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u308b\u306a\u3089\u3001`pre_get_posts`\u3067\u5b9f\u884c\u524d\u306e\u30af\u30a8\u30ea\u6761\u4ef6\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u306e`posts_per_page`\u30925\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u53e4\u3044`query_posts()`\u3068\u305d\u308c\u5c02\u7528\u306e`wp_reset_query()`\u3092\u5916\u3057\u3001\u30af\u30e9\u30b7\u30c3\u30af\u5b50\u30c6\u30fc\u30de\u306e`functions.php`\u306ePHP\u9818\u57df\u3078\u6b21\u306e\u95a2\u6570\u3068\u767b\u9332\u51e6\u7406\u30921\u56de\u3060\u3051\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3059\u3067\u306bPHP\u304c\u59cb\u307e\u3063\u3066\u3044\u308b\u5834\u6240\u3078`&lt;?php`\u3092\u91cd\u306d\u3066\u8cbc\u3089\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u901a\u5e38\u306e\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u3068\u30c6\u30fc\u30de\u306e\u30da\u30fc\u30b8\u9001\u308a\u306f\u6b8b\u3057\u307e\u3059\u3002<\/p>\n<p>WP Query Builder\u304c\u751f\u6210\u3059\u308b\u306e\u306f\u3001\u65b0\u3057\u304f\u4f5c\u308b`WP_Query`\u3078\u6e21\u3059`$args`\u3067\u3059\u3002\u3059\u3067\u306bWordPress\u304c\u7d44\u307f\u7acb\u3066\u305f\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5909\u66f4\u3059\u308b`pre_get_posts`\u306e\u30d5\u30c3\u30af\u3084\u3001\u7ba1\u7406\u753b\u9762\u30fb\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u30fbfeed\u3092\u9664\u5916\u3059\u308b\u6761\u4ef6\u5206\u5c90\u306f\u751f\u6210\u3057\u307e\u305b\u3093\u3002\u6b21\u306f\u3001\u305d\u306e\u5883\u754c\u3092\u542b\u3081\u3066\u624b\u52d5\u3067\u5b9f\u88c5\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"wpq-code-context wpq-code-context--functions\"><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>\u5b50\u30c6\u30fc\u30de\u306efunctions.php\u307e\u305f\u306f\u6a5f\u80fd\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u7f6e\u304f\u4f8b\u3067\u3059\u3002\u5bfe\u8c61\u753b\u9762\u3068\u5b9f\u884c\u6761\u4ef6\u3092\u78ba\u8a8d\u3057\u3001\u691c\u8a3c\u74b0\u5883\u3067\u8a66\u3057\u3066\u304b\u3089\u672c\u756a\u3078\u53cd\u6620\u3057\u3066\u304f\u3060\u3055\u3044\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\">functions.php<\/span><span class=\"code-purpose wpq-code-pill\">\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092pre_get_posts\u3067\u8abf\u6574\u3059\u308b\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: \u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092pre_get_posts\u3067\u8abf\u6574\u3059\u308b\u4f8b \/ functions.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">&lt;?php&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-keyword\">function<\/span> wpq_limit_home_posts( <span class=\"c-var\">$query<\/span> ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">if<\/span> ( is_admin() || ! <span class=\"c-var\">$query<\/span>-&gt;is_main_query() || <span class=\"c-var\">$query<\/span>-&gt;is_feed() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">return<\/span>;&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\">$query<\/span>-&gt;is_home() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$query<\/span>-&gt;set( <span class=\"c-str\">&#039;posts_per_page&#039;<\/span>, <span class=\"c-num\">5<\/span> );&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   }&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">}&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">add_action( <span class=\"c-str\">&#039;pre_get_posts&#039;<\/span>, <span class=\"c-str\">&#039;wpq_limit_home_posts&#039;<\/span> );&lt;br \/&gt;<\/span><\/code><\/pre><textarea class=\"wpq-code-raw\" hidden aria-hidden=\"true\" tabindex=\"-1\">&lt;br \/&gt;\n&lt;?php&lt;br \/&gt;\nfunction wpq_limit_home_posts( $query ) {&lt;br \/&gt;\n   if ( is_admin() || ! $query-&gt;is_main_query() || $query-&gt;is_feed() ) {&lt;br \/&gt;\n      return;&lt;br \/&gt;\n   }&lt;\/p&gt;\n&lt;p&gt;   if ( $query-&gt;is_home() ) {&lt;br \/&gt;\n      $query-&gt;set( &#039;posts_per_page&#039;, 5 );&lt;br \/&gt;\n   }&lt;br \/&gt;\n}&lt;br \/&gt;\nadd_action( &#039;pre_get_posts&#039;, &#039;wpq_limit_home_posts&#039; );&lt;br \/&gt;<\/textarea><\/div>\n<p>`$query-&gt;is_main_query()`\u3067\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3060\u3051\u3092\u5bfe\u8c61\u306b\u3057\u3001`is_admin()`\u3067\u7ba1\u7406\u753b\u9762\u3001`$query-&gt;is_feed()`\u3067\u30d5\u30a3\u30fc\u30c9\u3092\u9664\u5916\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u95a2\u6570\u81ea\u4f53\u306f\u8a18\u4e8b\u3092\u51fa\u529b\u305b\u305a\u3001\u65e2\u5b58\u306e\u6295\u7a3f\u4e00\u89a7\u304c\u53d6\u5f97\u3059\u308b\u4ef6\u6570\u3060\u3051\u3092\u5909\u3048\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">`pre_get_posts`\u306f\u300c\u3069\u306e\u753b\u9762\u306e\u3001\u3069\u306e\u30af\u30a8\u30ea\u3092\u5909\u3048\u308b\u304b\u300d\u307e\u3067\u9650\u5b9a\u3057\u3066\u521d\u3081\u3066\u5b89\u5168\u306b\u4f7f\u3048\u307e\u3059\u3002`posts_per_page`\u3060\u3051\u3092\u5408\u308f\u305b\u3066\u3001\u5bfe\u8c61\u5224\u5b9a\u3092\u7701\u304b\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/span>\n<p>\u3053\u3053\u3067\u306e`is_home()`\u306f\u300c\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u300d\u3092\u6307\u3057\u3001\u56fa\u5b9a\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\u3068\u5e38\u306b\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u7ba1\u7406\u753b\u9762\u306e\u300c\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306e\u8868\u793a\u300d\u306b\u3088\u3063\u3066\u5bfe\u8c61URL\u304c\u5909\u308f\u308b\u305f\u3081\u3001\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\u3060\u3051\u3092\u5909\u3048\u305f\u3044\u5834\u5408\u306f\u8981\u4ef6\u3068\u6761\u4ef6\u5206\u5c90\u3092\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002`pre_get_posts`\u306e\u6761\u4ef6\u3092\u5e83\u304f\u66f8\u304d\u3059\u304e\u308b\u3068\u3001\u30a2\u30fc\u30ab\u30a4\u30d6\u3084\u691c\u7d22\u7d50\u679c\u3001feed\u307e\u3067\u5909\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"main-query-results\" class=\"wpq-subheading\">\u540c\u3058\u6295\u7a3f\u4e00\u89a7\u306e\u30da\u30fc\u30b82\u3067\u8868\u793a\u3092\u6bd4\u3079\u308b<\/h3>\n<p>\u516c\u958b\u6e08\u307f\u306e\u901a\u5e38\u6295\u7a3f23\u4ef6\u304c\u3042\u308b\u6295\u7a3f\u4e00\u89a7\u3092\u4f7f\u3044\u3001`paged=2`\u3067\u8868\u793a\u3057\u307e\u3059\u3002\u53e4\u3044\u4f8b\u306f5\u4ef6\u3068\u3044\u3046\u6761\u4ef6\u3060\u3051\u3067\u30af\u30a8\u30ea\u3092\u4f5c\u308a\u76f4\u3059\u305f\u3081\u3001\u5143\u306e\u30da\u30fc\u30b8\u756a\u53f7\u3092\u5f15\u304d\u7d99\u304e\u307e\u305b\u3093\u3002`pre_get_posts`\u306e\u4f8b\u306f\u65e2\u5b58\u30af\u30a8\u30ea\u306e\u4ef6\u6570\u3060\u3051\u3092\u5909\u66f4\u3059\u308b\u306e\u3067\u3001\u30da\u30fc\u30b82\u3068\u3044\u3046\u6761\u4ef6\u304c\u6b8b\u308a\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">\u6b21\u306e\u753b\u50cf\u3067\u6bd4\u3079\u308b\u306e\u306f\u300c\u4f55\u4ef6\u51fa\u305f\u304b\u300d\u3060\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002URL\u306f\u3069\u3061\u3089\u3082\u30da\u30fc\u30b82\u306e\u307e\u307e\u306a\u306e\u306b\u3001\u65e7\u4f8b\u306f`paged=0`\u306e\u5225\u30af\u30a8\u30ea\u3078\u5dee\u3057\u66ff\u308f\u308a\u3001\u7f6e\u63db\u5f8c\u306f`paged=2`\u3092\u4fdd\u3063\u3066\u3044\u308b\u70b9\u304c\u5224\u65ad\u6750\u6599\u3067\u3059\u3002<\/span>\n<figure class=\"wpq-screenshot-frame wpq-screenshot-frame--fit-contain\"><span class=\"wpq-screenshot-frame__media\" style=\"--wpq-screenshot-ratio:98 \/ 79;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/query-posts-avoid-SC-01-scaled.png\" alt=\"\u6295\u7a3f\u4e00\u89a7\u306e\u30da\u30fc\u30b82\u3067query_posts\u3092\u4f7f\u3044\u3001ID13\u30fb82\u30fb81\u30fb80\u30fb79\u30fb15\u304c\u8868\u793a\u3055\u308c\u308b\u30b5\u30a4\u30c8\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u907f\u3051\u305f\u3044\u4f8b\u306e\u7d50\u679c<\/span><strong class=\"wpq-screenshot-frame__title\">\u30da\u30fc\u30b82\u306a\u306e\u306b\u3001\u5148\u982d\u5074\u306e\u8a18\u4e8b\u3078\u623b\u308b<\/strong><p class=\"wpq-screenshot-frame__caption-text\">query_posts\u5f8c\u306epaged\u306f0\u3002\u56fa\u5b9a\u6295\u7a3fID13\u306e\u5148\u982d\u8ffd\u52a0\u3082\u50cd\u304d\u3001ID13\u30fb82\u30fb81\u30fb80\u30fb79\u30fb15\u306e6\u4ef6\u304c\u51fa\u3066\u3044\u307e\u3059\u3002<\/p><\/figcaption><\/figure>\n<figure class=\"wpq-screenshot-frame wpq-screenshot-frame--fit-contain\"><span class=\"wpq-screenshot-frame__media\" style=\"--wpq-screenshot-ratio:196 \/ 145;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/08\/query-posts-avoid-SC-02-scaled.png\" alt=\"pre_get_posts\u3067\u4ef6\u6570\u3060\u3051\u3092\u5909\u66f4\u3057\u3001\u30da\u30fc\u30b82\u306eID14\u30fb13\u30fb12\u30fb11\u30fb10\u304c\u8868\u793a\u3055\u308c\u308b\u30b5\u30a4\u30c8\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">pre_get_posts\u3078\u7f6e\u304d\u63db\u3048<\/span><strong class=\"wpq-screenshot-frame__title\">\u30da\u30fc\u30b82\u306e\u6761\u4ef6\u3092\u6b8b\u3057\u30665\u4ef6\u3092\u8868\u793a<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u306eposts_per_page\u3060\u3051\u30925\u3078\u5909\u66f4\u3002paged=2\u3092\u4fdd\u3061\u3001ID14\u30fb13\u30fb12\u30fb11\u30fb10\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p><\/figcaption><\/figure>\n<p>\u3053\u306e\u6bd4\u8f03\u3067\u306f\u56fa\u5b9a\u6295\u7a3fID13\u306e\u8a2d\u5b9a\u3092\u6b8b\u3057\u3066\u3044\u307e\u3059\u30021\u30da\u30fc\u30b8\u76ee\u3067\u306f\u5148\u982d\u3078\u8ffd\u52a0\u3055\u308c\u30666\u4ef6\u306b\u306a\u308b\u4e00\u65b9\u30012\u30da\u30fc\u30b8\u76ee\u3067\u306f\u65e5\u4ed8\u9806\u306e\u672c\u6765\u306e\u4f4d\u7f6e\u306b\u3082\u51fa\u307e\u3059\u3002\u56fa\u5b9a\u6295\u7a3f\u306e\u8ffd\u52a0\u3084\u518d\u767b\u5834\u306f\u3001\u30da\u30fc\u30b8\u756a\u53f7\u304c\u5931\u308f\u308c\u308b\u554f\u984c\u3068\u306f\u5225\u3067\u3059\u3002\u5e38\u306b\u901a\u5e38\u306e\u65e5\u4ed8\u9806\u30fb5\u4ef6\u3078\u63c3\u3048\u305f\u3044\u5834\u5408\u306f\u3001`ignore_sticky_posts`\u306e\u65b9\u91dd\u3082[\u8868\u793a\u4ef6\u6570\u306e\u78ba\u8a8d](..\/post-count-mismatch\/)\u3067\u6574\u7406\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>`query_posts()`\u306e\u4f8b\u306f\u3001\u8868\u793a\u5f8c\u306e`wp_reset_query()`\u306b\u3088\u3063\u3066\u5143\u306e\u30af\u30a8\u30ea\u3078\u623b\u308a\u307e\u3057\u305f\u304c\u3001\u51fa\u529b\u6e08\u307f\u306e6\u4ef6\u306f\u305d\u306e\u307e\u307e\u3067\u3059\u3002`pre_get_posts`\u306e\u4f8b\u3067\u306f\u30af\u30a8\u30ea\u306e\u53c2\u7167\u5148\u3092\u5dee\u3057\u66ff\u3048\u305a\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u30fb\u691c\u7d22\u30fb\u30d5\u30a3\u30fc\u30c9\u30fb\u5225\u306e3\u4ef6\u53d6\u5f97\u306b\u306f\u3053\u306e\u4ef6\u6570\u5909\u66f4\u3092\u9069\u7528\u3057\u307e\u305b\u3093\u3002<\/p>\n\n<p>\u53e4\u3044\u30af\u30a8\u30ea\u306e\u7f6e\u304d\u63db\u3048\u306f\u3001\u672c\u756a\u3068\u5206\u3051\u305f\u74b0\u5883\u30671\u30da\u30fc\u30b8\u76ee\u30fb2\u30da\u30fc\u30b8\u76ee\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u3082\u8a66\u3059\u5834\u6240\u304c\u5fc5\u8981\u306a\u3089\u3001Xserver\u306ePHP\u5bfe\u5fdc\u3084\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u6761\u4ef6\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"secondary-loop\" 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\">\u5225\u306e\u4e00\u89a7\u3092\u8ffd\u52a0\u3057\u305f\u3044\u306a\u3089WP_Query\u304bget_posts\u3092\u4f7f\u3046<\/span><\/h2>\n<p>\u95a2\u9023\u8a18\u4e8b\u3084\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u65b0\u7740\u306a\u3069\u3001\u5225\u67a0\u306e\u4e00\u89a7\u306a\u3089`WP_Query`\u304b`get_posts()`\u3092\u4f7f\u3044\u307e\u3059\u3002\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5909\u3048\u308b\u5fc5\u8981\u306f\u3042\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: \u3084\u308a\u305f\u3044\u3053\u3068 \/ \u9078\u3073\u3084\u3059\u3044\u65b9\u6cd5 \/ \u7406\u7531\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u3084\u308a\u305f\u3044\u3053\u3068<\/th><th>\u9078\u3073\u3084\u3059\u3044\u65b9\u6cd5<\/th><th>\u7406\u7531<\/th><\/tr><\/thead><tbody><tr><td>\u6295\u7a3f\u4e00\u89a7\u3084\u30a2\u30fc\u30ab\u30a4\u30d6\u306e\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u305f\u3044<\/td><td>pre_get_posts<\/td><td>\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u304c\u5b9f\u884c\u3055\u308c\u308b\u524d\u306b\u5bfe\u8c61\u3092\u9650\u5b9a\u3057\u3066\u8abf\u6574\u3067\u304d\u308b<\/td><\/tr><tr><td>\u8a18\u4e8b\u4e0b\u306b\u95a2\u9023\u8a18\u4e8b\u3092\u8ffd\u52a0\u3057\u305f\u3044<\/td><td>WP_Query<\/td><td>\u72ec\u7acb\u3057\u305fquery\u3068\u3057\u3066\u30da\u30fc\u30b8\u9001\u308a\u3084\u72b6\u614b\u3092\u6271\u3048\u308b<\/td><\/tr><tr><td>\u5c11\u91cf\u306e\u6295\u7a3f\u914d\u5217\u3092\u53d6\u5f97\u3057\u305f\u3044<\/td><td>get_posts()<\/td><td>\u65e2\u5b9a\u3067\u306f5\u4ef6\u3067\u3001\u7dcf\u30da\u30fc\u30b8\u6570\u3092\u4f7f\u308f\u306a\u3044\u5c0f\u3055\u306a\u53d6\u5f97\u306b\u5411\u304f<\/td><\/tr><tr><td>\u53e4\u3044\u30b3\u30fc\u30c9\u3067query_posts\u3092\u898b\u3064\u3051\u305f<\/td><td>\u76ee\u7684\u3092\u78ba\u8a8d\u3057\u3066\u7f6e\u304d\u63db\u3048\u308b<\/td><td>\u30e1\u30a4\u30f3\u4e00\u89a7\u304b\u8ffd\u52a0\u4e00\u89a7\u304b\u3067\u6b63\u3057\u3044\u4ee3\u66ff\u304c\u5909\u308f\u308b<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>`get_posts()`\u306f`WP_Query`\u306e\u5358\u306a\u308b\u9ad8\u901f\u7248\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5c11\u91cf\u306e\u6295\u7a3f\u914d\u5217\u3092\u53d7\u3051\u53d6\u308b\u7528\u9014\u306b\u5411\u304d\u3001\u65e2\u5b9a\u306e\u53d6\u5f97\u4ef6\u6570\u306f5\u4ef6\u3067\u3059\u3002\u53d6\u5f97\u5f8c\u306b`setup_postdata()`\u3092\u4f7f\u3063\u3066\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306e\u53c2\u7167\u5148\u3092\u5207\u308a\u66ff\u3048\u305f\u5834\u5408\u306f\u3001\u6700\u5f8c\u306b`wp_reset_postdata()`\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306f\u901a\u5e38\u6295\u7a3f\u306e\u500b\u5225\u30da\u30fc\u30b8\u3067\u3001\u73fe\u5728\u306e\u8a18\u4e8b\u3092\u9664\u5916\u3057\u3001\u65b0\u77403\u4ef6\u3092\u5225\u30af\u30a8\u30ea\u3067\u8868\u793a\u3059\u308b\u4f8b\u3067\u3059\u3002\u30af\u30e9\u30b7\u30c3\u30af\u5b50\u30c6\u30fc\u30de\u306e`template-parts\/recent-posts.php`\u3078\u4fdd\u5b58\u3057\u3001`single.php`\u306a\u3069\u306e\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u5185\u3067`the_post()`\u3068\u672c\u6587\u8868\u793a\u306e\u5f8c\u306b`get_template_part( &#8216;template-parts\/recent-posts&#8217; );`\u3092\u547c\u3073\u307e\u3059\u3002\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u306b\u305d\u306e\u307e\u307e\u6d41\u7528\u3057\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u73fe\u5728\u306eWP Query Builder\u3067\u306f\u3001\u8a73\u7d30\u8a2d\u5b9a\u3067\u300cpost \/ publish \/ 3\u300d\u3001`order`\u306b\u300cDESC\u300d\u3001`orderby`\u306b\u300cdate\u300d\u3001`post__not_in`\u306b\u691c\u8a3c\u30da\u30fc\u30b8\u306e\u6295\u7a3fID\u300c15\u300d\u3001`ignore_sticky_posts`\u306b`true`\u3092\u5165\u529b\u3057\u307e\u3057\u305f\u3002\u81ea\u52d5\u9ad8\u901f\u5316\u306f\u30aa\u30d5\u3067\u3059\u3002\u6b21\u306e`$args`\u306f\u3001\u305d\u306e\u5b9f\u753b\u9762\u3067\u751f\u6210\u3055\u308c\u305f\u5185\u5bb9\u3092\u5909\u66f4\u305b\u305a\u306b\u8f09\u305b\u3066\u3044\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-parts\/recent-posts.php<\/span><span class=\"code-purpose wpq-code-pill\">\u73fe\u5728\u306e\u901a\u5e38\u6295\u7a3f\u3092\u9664\u5916\u3057\u3066\u65b0\u77403\u4ef6\u3092\u5225\u306eWP_Query\u3067\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: \u73fe\u5728\u306e\u901a\u5e38\u6295\u7a3f\u3092\u9664\u5916\u3057\u3066\u65b0\u77403\u4ef6\u3092\u5225\u306eWP_Query\u3067\u8868\u793a\u3059\u308b \/ template-parts\/recent-posts.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">&lt;?php&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-var\">$current_post_id<\/span> = get_queried_object_id();&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-var\">$args<\/span> = <span class=\"c-keyword\">array<\/span>(&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;order&#039;<\/span> =&gt; <span class=\"c-str\">&#039;DESC&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-key\">&#039;orderby&#039;<\/span> =&gt; <span class=\"c-str\">&#039;date&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-key\">&#039;post__not_in&#039;<\/span> =&gt; <span class=\"c-keyword\">array<\/span>(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-num\">15<\/span>&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   ),&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;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-var\">$args<\/span>[<span class=\"c-str\">&#039;post__not_in&#039;<\/span>] = <span class=\"c-keyword\">array<\/span>( <span class=\"c-var\">$current_post_id<\/span> );&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-var\">$related_query<\/span> = <span class=\"c-keyword\">new<\/span> <span class=\"c-fn\">WP_Query<\/span>( <span class=\"c-var\">$args<\/span> );&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-keyword\">if<\/span> ( <span class=\"c-var\">$related_query<\/span>-&gt;have_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\">while<\/span> ( <span class=\"c-var\">$related_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$related_query<\/span>-&gt;the_post();&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;      printf(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         <span class=\"c-str\">&#039;&lt;li&gt;&lt;a href=&quot;%s&quot;&gt;%s&lt;\/a&gt;\uff08ID: %d\uff09&lt;\/li&gt;&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_url( get_permalink() ),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         esc_html( get_the_title() ),&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">         get_the_ID()&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\">} <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&lt;?php&lt;br \/&gt;\n$current_post_id = get_queried_object_id();&lt;\/p&gt;\n&lt;p&gt;$args = array(&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;order&#039; =&gt; &#039;DESC&#039;,&lt;br \/&gt;\n   &#039;orderby&#039; =&gt; &#039;date&#039;,&lt;br \/&gt;\n   &#039;post__not_in&#039; =&gt; array(&lt;br \/&gt;\n      15&lt;br \/&gt;\n   ),&lt;br \/&gt;\n   &#039;ignore_sticky_posts&#039; =&gt; true&lt;br \/&gt;\n);&lt;\/p&gt;\n&lt;p&gt;$args[&#039;post__not_in&#039;] = array( $current_post_id );&lt;br \/&gt;\n$related_query = new WP_Query( $args );&lt;\/p&gt;\n&lt;p&gt;if ( $related_query-&gt;have_posts() ) {&lt;br \/&gt;\n   echo &#039;&lt;ul&gt;&#039;;&lt;\/p&gt;\n&lt;p&gt;   while ( $related_query-&gt;have_posts() ) {&lt;br \/&gt;\n      $related_query-&gt;the_post();&lt;\/p&gt;\n&lt;p&gt;      printf(&lt;br \/&gt;\n         &#039;&lt;li&gt;&lt;a href=&quot;%s&quot;&gt;%s&lt;\/a&gt;\uff08ID: %d\uff09&lt;\/li&gt;&#039;,&lt;br \/&gt;\n         esc_url( get_permalink() ),&lt;br \/&gt;\n         esc_html( get_the_title() ),&lt;br \/&gt;\n         get_the_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} 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>Builder\u304c\u751f\u6210\u3057\u305f\u306e\u306f`$args`\u307e\u3067\u3067\u3059\u3002`$current_post_id`\u306e\u53d6\u5f97\u3068`post__not_in`\u3092\u73fe\u5728\u306e\u8a18\u4e8bID\u3078\u7f6e\u304d\u63db\u3048\u308b1\u884c\u3001`new WP_Query()`\u3001\u30ea\u30f3\u30af\u3068\u6295\u7a3fID\u306e\u8868\u793a\u30010\u4ef6\u6642\u306e\u6587\u8a00\u3001`wp_reset_postdata()`\u306f\u624b\u52d5\u3067\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002\u691c\u8a3c\u30da\u30fc\u30b8\u3067\u306f\u73fe\u5728\u306e\u8a18\u4e8b\u3082ID15\u306a\u306e\u3067\u3001\u7f6e\u304d\u63db\u3048\u524d\u5f8c\u306e\u9664\u5916\u5024\u306f\u540c\u3058\u3067\u3059\u3002\u672c\u756a\u3067\u306f\u8868\u793a\u4e2d\u306e\u8a18\u4e8bID\u306b\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n<p>`$related_query`\u3060\u3051\u3092\u56de\u3057\u3001`the_post()`\u3092\u4f7f\u3063\u305f\u5f8c\u306f`wp_reset_postdata()`\u3067\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3057\u307e\u3059\u3002\u540c\u3058\u516c\u958b\u65e5\u6642\u306e\u6295\u7a3f\u540c\u58eb\u307e\u3067\u9806\u756a\u3092\u56fa\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001Builder\u751f\u6210\u5f8c\u306b`orderby`\u3078ID\u306e\u7b2c2\u6761\u4ef6\u3092\u52a0\u3048\u308b\u8a2d\u8a08\u304c\u5225\u9014\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u4f8b\u3068\u753b\u50cf\u306f\u3001\u516c\u958b\u65e5\u304c\u7570\u306a\u308b\u691c\u8a3c\u6295\u7a3f\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">Builder\u306e\u56fa\u5b9a\u502415\u306f\u5b9f\u753b\u9762\u3068\u691c\u8a3c\u7d50\u679c\u3092\u518d\u73fe\u3059\u308b\u5165\u529b\u3067\u3059\u3002\u518d\u5229\u7528\u6642\u306f\u3001\u305d\u306e\u5024\u3092\u6b8b\u3059\u306e\u3067\u306f\u306a\u304f\u3001\u76f4\u5f8c\u306e\u624b\u52d5\u884c\u3067\u73fe\u5728\u306e\u8a18\u4e8bID\u3078\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/span>\n<p>\u901a\u5e38\u6295\u7a3fID15\u306e\u672c\u6587\u5f8c\u3067\u3053\u306e\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3059\u3068\u3001\u5225\u4e00\u89a7\u306fID82\u30fb81\u30fb80\u306e3\u4ef6\u306b\u306a\u308a\u3001\u51e6\u7406\u5f8c\u306e`get_the_ID()`\u306f15\u3078\u623b\u308a\u307e\u3059\u3002\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u306e\u53c2\u7167\u5148\u3082\u5909\u308f\u308a\u307e\u305b\u3093\u3002\u5bfe\u8c61\u306e\u6295\u7a3f\u30bf\u30a4\u30d7\u306b\u516c\u958b\u6295\u7a3f\u304c\u306a\u3051\u308c\u3070\u30010\u4ef6\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3057\u305f\u5f8c\u3082ID15\u306e\u307e\u307e\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u4f8b\u306f\u65b0\u7740\u4e00\u89a7\u3067\u3042\u308a\u3001\u540c\u3058\u30ab\u30c6\u30b4\u30ea\u30fc\u3084\u30bf\u30b0\u3067\u95a2\u9023\u8a18\u4e8b\u3092\u9078\u3076\u6761\u4ef6\u307e\u3067\u306f\u542b\u307f\u307e\u305b\u3093\u3002\u78ba\u8a8d\u7528\u3068\u3057\u3066\u8ffd\u52a0\u3057\u305f\u5834\u5408\u306f\u3001\u547c\u3073\u51fa\u3057\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u64a4\u53bb\u3057\u307e\u3059\u3002\u95a2\u6570\u5074\u306e\u4f8b\u3092\u5916\u3059\u5834\u5408\u3082\u3001\u95a2\u6570\u5b9a\u7fa9\u3068\u5bfe\u5fdc\u3059\u308b`add_action()`\u3092\u30bb\u30c3\u30c8\u3067\u623b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<span class=\"wpq-marker wpq-marker--yellow\">\u7f6e\u304d\u63db\u3048\u5f8c\u306b\u623b\u3059\u6642\u3082\u3001`functions.php`\u306e\u95a2\u6570\u3060\u3051\u3001\u307e\u305f\u306f`add_action()`\u3060\u3051\u3092\u6b8b\u3055\u306a\u3044\u3067\u304f\u3060\u3055\u3044\u3002\u5225\u4e00\u89a7\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d1\u30fc\u30c4\u3068\u547c\u3073\u51fa\u3057\u5074\u3092\u5bfe\u3067\u7ba1\u7406\u3057\u307e\u3059\u3002<\/span>\n\n<p>\u8ffd\u52a0\u4e00\u89a7\u3092WP_Query\u3078\u7f6e\u304d\u63db\u3048\u308b\u3068\u6c7a\u3081\u305f\u3089\u3001WP Query Builder\u3067\u305d\u306e\u53d6\u5f97\u6761\u4ef6\u3092\u6574\u7406\u3067\u304d\u307e\u3059\u3002\u751f\u6210\u3057\u305f$args\u3092\u5225\u4e00\u89a7\u306e\u8868\u793a\u30eb\u30fc\u30d7\u3078\u6e21\u3057\u3001\u5143\u306e\u8a18\u4e8b\u306e\u53c2\u7167\u5148\u304c\u623b\u308b\u3053\u3068\u307e\u3067\u78ba\u304b\u3081\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>\u7f6e\u304d\u63db\u3048\u5f8c\u306eWP_Query\u6761\u4ef6\u3092\u4f5c\u308b<\/h3><p>\u5225\u4e00\u89a7\u7528\u306epost_type\u3001\u4ef6\u6570\u3001\u7d5e\u308a\u8fbc\u307f\u3001\u4e26\u3073\u9806\u304b\u3089$args\u3092\u4f5c\u308c\u307e\u3059\u3002pre_get_posts\u306e\u6761\u4ef6\u5206\u5c90\u3001\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3001\u30ea\u30bb\u30c3\u30c8\u4f4d\u7f6e\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5074\u3067\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=\"replacement-flow\" 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\">\u53e4\u3044query_posts\u30b3\u30fc\u30c9\u3092\u898b\u3064\u3051\u305f\u6642\u306e\u7f6e\u304d\u63db\u3048\u65b9<\/span><\/h2>\n<p>\u53e4\u3044\u30b3\u30fc\u30c9\u306f\u6a5f\u68b0\u7f6e\u63db\u305b\u305a\u3001\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u76f4\u524d\u306a\u306e\u304b\u3001\u8a18\u4e8b\u4e0b\u3084\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u5c0f\u3055\u306a\u4e00\u89a7\u306a\u306e\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<section class=\"debug-steps wpq-steps-card\"><h2>query_posts\u3092\u898b\u3064\u3051\u305f\u6642\u306e\u78ba\u8a8d\u9806<\/h2><ol class=\"step-list wpq-steps\"><li><span class=\"step-number wpq-step-no\">1<\/span><div class=\"step-body wpq-step-body\">\u305d\u306e\u30b3\u30fc\u30c9\u304c\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u3066\u3044\u308b\u306e\u304b\u3001\u8ffd\u52a0\u4e00\u89a7\u3092\u4f5c\u3063\u3066\u3044\u308b\u306e\u304b\u78ba\u8a8d\u3059\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">2<\/span><div class=\"step-body wpq-step-body\">\u30e1\u30a4\u30f3\u4e00\u89a7\u306a\u3089`pre_get_posts`\u3001\u8ffd\u52a0\u4e00\u89a7\u306a\u3089`WP_Query`\u307e\u305f\u306f`get_posts()`\u3092\u5019\u88dc\u306b\u3059\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">3<\/span><div class=\"step-body wpq-step-body\">query vars\u3001URL\u6761\u4ef6\u3001\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3092\u4fdd\u3063\u305f\u307e\u307e\u7f6e\u304d\u63db\u3048\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">4<\/span><div class=\"step-body wpq-step-body\">1\u30da\u30fc\u30b8\u76ee\u30682\u30da\u30fc\u30b8\u76ee\u3001archive\u3001search\u3001404\u3001feed\u3067\u56de\u5e30\u78ba\u8a8d\u3059\u308b<\/div><\/li><\/ol><\/section>\n<p>`query_posts()`\u3068\u4e00\u7dd2\u306b\u3042\u308b`wp_reset_query()`\u3082\u3001`WP_Query`\u306e\u30eb\u30fc\u30d7\u3078\u5909\u3048\u305f\u5834\u5408\u306f`wp_reset_postdata()`\u3078\u5909\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u53d6\u5f97\u65b9\u6cd5\u3068\u5f8c\u51e6\u7406\u3092\u30bb\u30c3\u30c8\u3067\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"official-docs\" class=\"h-underline section-heading\"><span class=\"section-heading-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><span class=\"section-heading-text\">query_posts()\u306e\u6ce8\u610f\u70b9\u3068\u4ee3\u66ff\u624b\u6bb5\u306e\u516c\u5f0f\u8cc7\u6599<\/span><\/h2>\n<p>\u516c\u5f0f\u8cc7\u6599\u3067`query_posts()`\u306e\u6ce8\u610f\u3001`pre_get_posts`\u306e\u5bfe\u8c61\u9650\u5b9a\u3001`WP_Query`\u3068`get_posts()`\u306e\u9055\u3044\u3092\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\">\u516c\u5f0f\u30ea\u30f3\u30af<\/p><h2>\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\/functions\/query_posts\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">query_posts()<\/strong><span class=\"wpq-reference-item__description\">query_posts\u3092\u907f\u3051\u308b\u3079\u304d\u7406\u7531\u3068\u6ce8\u610f\u70b9\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\/hooks\/pre_get_posts\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">pre_get_posts<\/strong><span class=\"wpq-reference-item__description\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u524d\u306b\u8abf\u6574\u3059\u308b\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\/reference\/classes\/wp_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Query Class<\/strong><span class=\"wpq-reference-item__description\">\u5225\u306e\u6295\u7a3f\u4e00\u89a7\u3092\u4f5c\u308b\u305f\u3081\u306e\u57fa\u672c\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_posts\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">get_posts()<\/strong><span class=\"wpq-reference-item__description\">\u30b7\u30f3\u30d7\u30eb\u306b\u6295\u7a3f\u914d\u5217\u3092\u53d6\u5f97\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_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">wp_reset_query()<\/strong><span class=\"wpq-reference-item__description\">query_posts\u5f8c\u306e\u30ea\u30bb\u30c3\u30c8\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\/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\">WP_Query\u306e\u5225\u30eb\u30fc\u30d7\u5f8c\u306b\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><\/ul><\/section>\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>\u6700\u5f8c\u306b\u78ba\u8a8d\u3057\u305f\u3044\u3053\u3068<\/h2><\/div><ul class=\"wpq-checklist\"><li>query_posts\u306f\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u7f6e\u304d\u63db\u3048\u308b\u95a2\u6570\u3060\u3068\u7406\u89e3\u3057\u3066\u3044\u308b<\/li><li>\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u3048\u308b\u306a\u3089pre_get_posts\u3092\u691c\u8a0e\u3067\u304d\u308b<\/li><li>\u5225\u4e00\u89a7\u3092\u4f5c\u308b\u306a\u3089WP_Query\u307e\u305f\u306fget_posts\u3092\u691c\u8a0e\u3067\u304d\u308b<\/li><li>query_posts\u3092\u898b\u3064\u3051\u305f\u6642\u306b\u76ee\u7684\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u7f6e\u304d\u63db\u3048\u5148\u3092\u9078\u3079\u308b<\/li><li>WP_Query\u306e\u5225\u30eb\u30fc\u30d7\u5f8c\u306bwp_reset_postdata()\u3092\u7f6e\u3044\u305f<\/li><\/ul><\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u53e4\u3044\u30c6\u30fc\u30de\u3084\u89e3\u8aac\u3067query_posts\u3092\u898b\u3064\u3051\u305f\u4eba\u5411\u3051\u306b\u3001\u4f7f\u308f\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u7406\u7531\u3068\u3001pre_get_posts\u30fbWP_Query\u30fbget_posts\u306e\u9078\u3073\u5206\u3051\u3001\u5b89\u5168\u306a\u7f6e\u304d\u63db\u3048\u624b\u9806\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","meta":{"wpq_kicker":"WP_Query\u89e3\u8aac","wpq_lead":"\u30c6\u30fc\u30de\u3092\u7de8\u96c6\u3057\u3066\u3044\u3066query_posts()\u3092\u898b\u3064\u3051\u305f\u3089\u3001\u305d\u306e\u307e\u307e\u771f\u4f3c\u305b\u305a\u300c\u73fe\u5728\u306e\u6295\u7a3f\u4e00\u89a7\u3092\u5909\u3048\u308b\u30b3\u30fc\u30c9\u304b\u3001\u5225\u306e\u4e00\u89a7\u3092\u8ffd\u52a0\u3059\u308b\u30b3\u30fc\u30c9\u304b\u300d\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30e1\u30a4\u30f3\u4e00\u89a7\u306a\u3089pre_get_posts\u3001\u8a18\u4e8b\u4e0b\u3084\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u5225\u4e00\u89a7\u306a\u3089WP_Query\u307e\u305f\u306fget_posts()\u304c\u57fa\u672c\u3067\u3059\u3002","wpq_hero_title_line1":"","wpq_hero_title_line2":"","wpq_hero_title_accent":"","wpq_hero_thumbnail_alt":"query_posts\u3092\u4f7f\u308f\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u7406\u7531\uff5cWP_Query\u30fbpre_get_posts\u3068\u306e\u9055\u3044 \u306e\u30d2\u30fc\u30ed\u30fc\u30b5\u30e0\u30cd\u30a4\u30eb","wpq_hero_summary_mode":"","wpq_hero_summary_label":"\u7528\u9014\u3067\u4f7f\u3044\u5206\u3051\u308b","wpq_hero_summary_items":"`pre_get_posts`::\u30e1\u30a4\u30f3\u4e00\u89a7\u3092\u5909\u66f4\n`WP_Query`::\u5225\u4e00\u89a7\u3092\u8ffd\u52a0","wpq_reading_time":"","wpq_difficulty_label":"","wpq_difficulty_stars":"3","wpq_target_audience":"WordPress\u30c6\u30fc\u30de\u5185\u3067\u6295\u7a3f\u4e00\u89a7\u306e\u6761\u4ef6\u3092\u5909\u3048\u305f\u3044\u304c\u3001query_posts\u3092\u4f7f\u3063\u3066\u3088\u3044\u306e\u304b\u4e0d\u5b89\u306a\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":"query_posts()|https:\/\/developer.wordpress.org\/reference\/functions\/query_posts\/\npre_get_posts|https:\/\/developer.wordpress.org\/reference\/hooks\/pre_get_posts\/\nWP_Query Class|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\nget_posts()|https:\/\/developer.wordpress.org\/reference\/functions\/get_posts\/\nwp_reset_query()|https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_query\/\nwp_reset_postdata()|https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/","wpq_pr_notice":"","wpq_affiliate_placement":"","wpq_affiliate_program":"","wpq_affiliate_context":"","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":[130,21,129,131],"wpq_card_label":[3,6],"wpq_difficulty":[12],"class_list":["post-3893","wpq_article","type-wpq_article","status-publish","hentry","category-basic","tag-get_posts","tag-pre_get_posts","tag-query_posts","tag-131"],"_links":{"self":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/3893","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\/2"}],"version-history":[{"count":3,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/3893\/revisions"}],"predecessor-version":[{"id":4063,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/3893\/revisions\/4063"}],"wp:attachment":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media?parent=3893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/categories?post=3893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/tags?post=3893"},{"taxonomy":"wpq_card_label","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_card_label?post=3893"},{"taxonomy":"wpq_difficulty","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_difficulty?post=3893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}