{"id":463,"date":"2026-08-20T13:30:21","date_gmt":"2026-08-20T04:30:21","guid":{"rendered":"https:\/\/wptoolslab.com\/query-lab\/?post_type=wpq_glossary&amp;p=463"},"modified":"2026-08-29T22:53:42","modified_gmt":"2026-08-29T13:53:42","slug":"wp-query","status":"publish","type":"wpq_glossary","link":"https:\/\/wptoolslab.com\/query-lab\/glossary\/wp-query\/","title":{"rendered":"WP_Query"},"content":{"rendered":"<section class=\"conclusion wpq-conclusion\"><h2 class=\"wpq-conclusion__title\">\u307e\u305a\u7d50\u8ad6<\/h2><p>`WP_Query` \u306f\u3001WordPress \u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002`post_type`\u3001`posts_per_page`\u3001`orderby`\u3001`tax_query`\u3001`meta_query` \u306a\u3069\u306e\u6761\u4ef6\u3092 `$args` \u306b\u6307\u5b9a\u3057\u3001\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u3092\u30eb\u30fc\u30d7\u3067\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<\/section>\n<p>`WP_Query` \u306f\u3001WordPress \u3067\u300c\u3069\u306e\u6295\u7a3f\u3092\u3001\u3069\u3093\u306a\u6761\u4ef6\u3067\u3001\u4f55\u4ef6\u3001\u3069\u306e\u9806\u756a\u3067\u53d6\u5f97\u3059\u308b\u304b\u300d\u3092\u6c7a\u3081\u308b\u305f\u3081\u306e\u4e2d\u5fc3\u7684\u306a\u4ed5\u7d44\u307f\u3067\u3059\u3002\u901a\u5e38\u6295\u7a3f\u306e\u4e00\u89a7\u3060\u3051\u3067\u306a\u304f\u3001\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u5225\u4e00\u89a7\u3001\u30bf\u30b0\u5225\u4e00\u89a7\u3001\u95a2\u9023\u8a18\u4e8b\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u6761\u4ef6\u4ed8\u304d\u306e\u4e00\u89a7\u306a\u3069\u3067\u3082\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<p>\u521d\u5fc3\u8005\u304c\u6700\u521d\u306b\u62bc\u3055\u3048\u308b\u3079\u304d\u306a\u306e\u306f\u3001`WP_Query` \u306f\u300c\u8868\u793a\u305d\u306e\u3082\u306e\u300d\u3067\u306f\u306a\u304f\u300c\u53d6\u5f97\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u3066\u6295\u7a3f\u3092\u53d6\u308a\u51fa\u3059\u4ed5\u7d44\u307f\u300d\u3060\u3068\u3044\u3046\u70b9\u3067\u3059\u3002\u5b9f\u969b\u306b\u753b\u9762\u3078\u51fa\u3059\u306b\u306f\u3001\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u3092\u30eb\u30fc\u30d7\u3067\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"what-is-wp-query\" 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\">WP_Query \u306f\u4f55\u3092\u3059\u308b\u3082\u306e\u304b<\/span><\/h2>\n<p>`WP_Query` \u306f\u3001\u6295\u7a3f\u3092\u691c\u7d22\u30fb\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e WordPress \u306e\u30af\u30e9\u30b9\u3067\u3059\u3002\u3069\u306e\u6295\u7a3f\u30bf\u30a4\u30d7\u304b\u3089\u53d6\u5f97\u3059\u308b\u304b\u3001\u4f55\u4ef6\u53d6\u5f97\u3059\u308b\u304b\u3001\u3069\u306e\u9806\u756a\u306b\u3059\u308b\u304b\u3001\u3069\u306e\u30ab\u30c6\u30b4\u30ea\u30fc\u3084\u30bf\u30b0\u306b\u5c5e\u3059\u308b\u6295\u7a3f\u306b\u3059\u308b\u304b\u3001\u3068\u3044\u3063\u305f\u6761\u4ef6\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>`WP_Query` \u3092\u4f7f\u3046\u3068\u3001WordPress \u304c\u6301\u3063\u3066\u3044\u308b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u6761\u4ef6\u306b\u5408\u308f\u305b\u3066\u53d6\u308a\u51fa\u305b\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u300c\u6700\u65b0\u8a18\u4e8b\u30923\u4ef6\u3060\u3051\u8868\u793a\u3059\u308b\u300d\u300c\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u306e\u5546\u54c1\u309210\u4ef6\u8868\u793a\u3059\u308b\u300d\u300c\u7279\u5b9a\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u8a18\u4e8b\u3060\u3051\u51fa\u3059\u300d\u3068\u3044\u3063\u305f\u5b9f\u88c5\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>`WP_Query` \u306f\u3001\u8a18\u4e8b\u4e00\u89a7\u3092\u4f5c\u308b\u305f\u3081\u306e\u9053\u5177\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u3059\u3079\u3066\u306e\u4e00\u89a7\u3067\u5fc5\u305a\u65b0\u3057\u3044 `WP_Query` \u3092\u4f5c\u308c\u3070\u3088\u3044\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30c6\u30fc\u30de\u304c\u3059\u3067\u306b\u8868\u793a\u3057\u3066\u3044\u308b\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u3001\u72ec\u81ea\u306b\u4f5c\u308b\u30b5\u30d6\u30af\u30a8\u30ea\u3092\u5206\u3051\u3066\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u307e\u305a\u306f\u300c\u72ec\u81ea\u4e00\u89a7\u3092\u8ffd\u52a0\u3057\u305f\u3044\u6642\u306b `WP_Query` \u3092\u4f7f\u3046\u300d\u3068\u8003\u3048\u308b\u3068\u5206\u304b\u308a\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u65e2\u5b58\u306e\u30a2\u30fc\u30ab\u30a4\u30d6\u3084\u691c\u7d22\u7d50\u679c\u306e\u6761\u4ef6\u3092\u5909\u3048\u305f\u3044\u5834\u5408\u306f\u3001\u5225\u306e\u65b9\u6cd5\u3092\u691c\u8a0e\u3059\u308b\u3053\u3068\u3082\u3042\u308a\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\">wp-query-basic.php<\/span><span class=\"code-purpose wpq-code-pill\">\u6700\u65b0\u306e\u901a\u5e38\u6295\u7a3f\u30923\u4ef6\u53d6\u5f97\u3057\u3066\u8868\u793a\u3059\u308b\u6700\u5c0f\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: \u6700\u65b0\u306e\u901a\u5e38\u6295\u7a3f\u30923\u4ef6\u53d6\u5f97\u3057\u3066\u8868\u793a\u3059\u308b\u6700\u5c0f\u4f8b \/ wp-query-basic.php \/ PHP\"><code><span class=\"wpq-code-line\">&lt;br \/&gt;<\/span><span class=\"wpq-code-line\"><span class=\"c-var\">$args<\/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\">];&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;<span class=\"c-var\">$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\">$query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">while<\/span> ( <span class=\"c-var\">$query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$query<\/span>-&gt;the_post();&lt;\/p&gt;<\/span><span class=\"wpq-code-line\">&lt;p&gt;      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\">   }&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$args = [&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];&lt;\/p&gt;\n&lt;p&gt;$query = new WP_Query( $args );&lt;\/p&gt;\n&lt;p&gt;if ( $query-&gt;have_posts() ) {&lt;br \/&gt;\n   while ( $query-&gt;have_posts() ) {&lt;br \/&gt;\n      $query-&gt;the_post();&lt;\/p&gt;\n&lt;p&gt;      the_title( &#039;&lt;h2&gt;&#039;, &#039;&lt;\/h2&gt;&#039; );&lt;br \/&gt;\n   }&lt;br \/&gt;\n}&lt;\/p&gt;\n&lt;p&gt;wp_reset_postdata();&lt;br \/&gt;<\/textarea><\/div>\n<h2 id=\"main-query-and-custom-query\" 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\">\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u72ec\u81ea\u30af\u30a8\u30ea\u306e\u9055\u3044<\/span><\/h2>\n<p>WordPress \u306b\u306f\u3001\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u6700\u521d\u304b\u3089\u7528\u610f\u3055\u308c\u308b\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u304c\u3042\u308a\u307e\u3059\u3002\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u30a2\u30fc\u30ab\u30a4\u30d6\u3001\u691c\u7d22\u7d50\u679c\u3001\u6295\u7a3f\u8a73\u7d30\u306a\u3069\u306f\u3001WordPress \u304c\u8868\u793a\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3001`new WP_Query()` \u3067\u81ea\u5206\u3067\u4f5c\u308b\u30af\u30a8\u30ea\u306f\u72ec\u81ea\u30af\u30a8\u30ea\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u8a18\u4e8b\u672c\u6587\u306e\u4e0b\u306b\u95a2\u9023\u8a18\u4e8b\u3092\u51fa\u3057\u305f\u308a\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306e\u4e00\u90e8\u306b\u6700\u65b0\u8a18\u4e8b\u3092\u51fa\u3057\u305f\u308a\u3059\u308b\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u72ec\u81ea\u30af\u30a8\u30ea\u3092\u4f7f\u3063\u305f\u5f8c\u306b `wp_reset_postdata()` \u3092\u5fd8\u308c\u308b\u3068\u3001\u305d\u306e\u5f8c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u610f\u56f3\u3057\u306a\u3044\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u53c2\u7167\u3059\u308b\u539f\u56e0\u306b\u306a\u308a\u307e\u3059\u3002\u7279\u306b\u30b5\u30a4\u30c9\u30d0\u30fc\u3001\u95a2\u9023\u8a18\u4e8b\u3001\u30ab\u30fc\u30c9\u4e00\u89a7\u306a\u3069\u3092\u8ffd\u52a0\u3059\u308b\u6642\u306f\u6ce8\u610f\u3057\u307e\u3059\u3002<\/p>\n<p>WP_Query \u3092\u5b66\u3076\u6642\u306f\u3001\u307e\u305a\u72ec\u81ea\u4e00\u89a7\u306e\u4f5c\u308a\u65b9\u3092\u7406\u89e3\u3057\u3001\u305d\u306e\u5f8c\u3067\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u306e\u9055\u3044\u3092\u78ba\u8a8d\u3059\u308b\u6d41\u308c\u304c\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<h2 id=\"builder\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"builder\" 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\">Builder \u3067\u306e\u6271\u3044<\/span><\/h2>\n<p>WP Query Builder \u3067\u306f\u3001`WP_Query` \u306f\u751f\u6210\u3055\u308c\u308b\u30b3\u30fc\u30c9\u5168\u4f53\u306e\u571f\u53f0\u3068\u3057\u3066\u6271\u3046\u60f3\u5b9a\u3067\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u3093\u3060\u6295\u7a3f\u30bf\u30a4\u30d7\u3001\u4ef6\u6570\u3001\u4e26\u3073\u9806\u3001\u5206\u985e\u6761\u4ef6\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u6761\u4ef6\u3001\u65e5\u4ed8\u6761\u4ef6\u3092 `$args` \u306b\u5909\u63db\u3057\u3001\u6700\u7d42\u7684\u306b `new WP_Query( $args )` \u306e\u5f62\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u521d\u5fc3\u8005\u5411\u3051\u306b\u306f\u3001\u3044\u304d\u306a\u308a `WP_Query` \u306e\u5168\u5f15\u6570\u3092\u898b\u305b\u308b\u3088\u308a\u3001\u300c\u4f55\u3092\u53d6\u5f97\u3059\u308b\u304b\u300d\u300c\u4f55\u4ef6\u53d6\u5f97\u3059\u308b\u304b\u300d\u300c\u3069\u3046\u4e26\u3079\u308b\u304b\u300d\u300c\u4f55\u3067\u7d5e\u308a\u8fbc\u3080\u304b\u300d\u306e\u9806\u756a\u3067\u5165\u529b\u3055\u305b\u308b\u3068\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>Builder \u3067\u91cd\u8981\u306a\u306e\u306f\u3001\u6761\u4ef6\u3092\u5897\u3084\u3057\u3059\u304e\u305f\u6642\u306b\u539f\u56e0\u3092\u5207\u308a\u5206\u3051\u3089\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3059\u3002\u751f\u6210\u30b3\u30fc\u30c9\u3067\u3082\u3001\u57fa\u672c\u6761\u4ef6\u3001\u5206\u985e\u6761\u4ef6\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u6761\u4ef6\u3001\u65e5\u4ed8\u6761\u4ef6\u3092\u8aad\u307f\u5206\u3051\u3084\u3059\u304f\u3059\u308b\u3068\u3001\u521d\u5fc3\u8005\u304c\u4fee\u6b63\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2 id=\"practical-article\" 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\">\u4f7f\u3044\u3069\u3053\u308d\u30fb\u907f\u3051\u3069\u3053\u308d\u3068\u5b9f\u8df5\u78ba\u8a8d<\/span><\/h2>\n<p>WordPress\u306e\u6295\u7a3f\u3092\u6761\u4ef6\u4ed8\u304d\u3067\u53d6\u5f97\u3057\u3001\u7d50\u679c\u4ef6\u6570\u3084\u30da\u30fc\u30b8\u60c5\u5831\u3092\u6301\u3064\u5c02\u7528\u306e\u30af\u30a8\u30ea\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u5fc5\u8981\u306a\u6642\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5185\u3067\u7f6e\u304d\u63db\u3048\u308b\u76ee\u7684\u3084\u3001\u5358\u7d14\u306a1\u4ef6\u53d6\u5f97\u307e\u3067\u5e38\u306b\u65b0\u3057\u3044 `WP_Query` \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u306e\u306f\u907f\u3051\u307e\u3059\u3002<\/p>\n<p>\u53d6\u5f97\u6761\u4ef6\u3060\u3051\u3067\u306a\u304f\u3001\u30eb\u30fc\u30d7\u4e2d\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u72b6\u614b\u3068\u7d42\u4e86\u5f8c\u306e\u30ea\u30bb\u30c3\u30c8\u307e\u3067\u3092\u4e00\u9023\u306e\u5b9f\u88c5\u3068\u3057\u3066\u6271\u3044\u307e\u3059\u3002<\/p>\n<p>\u72ec\u81ea\u4e00\u89a7\u3092\u8db3\u3059\u306a\u3089 `WP_Query`\u3001\u65e2\u5b58\u306e\u4e00\u89a7\u6761\u4ef6\u3092\u5909\u3048\u308b\u306a\u3089\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u306e\u8abf\u6574\u3001\u3068\u3044\u3046\u5207\u308a\u5206\u3051\u304c\u51fa\u767a\u70b9\u3067\u3059\u3002<\/p>\n<p>\u6700\u5c0f\u69cb\u6210\u306e `$args` \u3067\u53d6\u5f97\u3067\u304d\u305f\u6295\u7a3fID\u3001`post_count`\u3001`found_posts` \u3092\u78ba\u8a8d\u3057\u3001\u30eb\u30fc\u30d7\u524d\u5f8c\u306e\u73fe\u5728\u306e\u6295\u7a3fID\u3082\u8a18\u9332\u3057\u307e\u3059\u3002<\/p>\n<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 \u306e\u30b5\u30e0\u30cd\u30a4\u30eb\" 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>\u5b9f\u8df5\u8a18\u4e8b\u3067\u78ba\u8a8d<\/small><b>WP_Query\u3068\u306f\uff1f\u521d\u5fc3\u8005\u5411\u3051\u306b\u5f79\u5272\u3068\u4f7f\u3044\u65b9\u3092\u89e3\u8aac<\/b><p>`WP_Query` \u306e\u5f79\u5272\u3001\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3068\u306e\u9055\u3044\u3001\u57fa\u672c\u7684\u306a\u5229\u7528\u5834\u9762\u3092\u5168\u4f53\u50cf\u304b\u3089\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p><span class=\"jump\"><span>\u8a18\u4e8b\u3092\u8aad\u3080 \u2192<\/span><\/span><\/div><\/a>\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\">WordPress\u306e\u4ed5\u69d8\u3067\u78ba\u8a8d\u3059\u308b\u30dd\u30a4\u30f3\u30c8<\/span><\/h2>\n<p>\u516c\u5f0f\u8cc7\u6599\u3067\u306f\u3001WP_Query Class \u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3067\u3001\u6295\u7a3f\u30bf\u30a4\u30d7\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u3001\u4ef6\u6570\u3001\u4e26\u3073\u9806\u3001\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3001\u65e5\u4ed8\u306a\u3069\u306e\u5f15\u6570\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u72ec\u81ea\u30af\u30a8\u30ea\u5f8c\u306b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3059 `wp_reset_postdata()`\u3001\u30c6\u30fc\u30de\u3067\u6295\u7a3f\u3092\u8868\u793a\u3059\u308b The Loop \u3082\u5408\u308f\u305b\u3066\u78ba\u8a8d\u3059\u308b\u3068\u3001WP_Query \u306e\u4f7f\u3044\u3069\u3053\u308d\u3092\u7406\u89e3\u3057\u3084\u3059\u304f\u306a\u308a\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\/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\">WP_Query \u306e\u5f15\u6570\u3068\u57fa\u672c\u69cb\u9020\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\">\u72ec\u81ea\u30af\u30a8\u30ea\u5f8c\u306b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3059\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\/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\">\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3067\u8868\u793a\u3059\u308b\u6d41\u308c\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<p>`WP_Query` \u306f\u3001WordPress \u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u4e2d\u5fc3\u7684\u306a\u30af\u30e9\u30b9\u3067\u3059\u3002`$args` \u306b\u6761\u4ef6\u3092\u66f8\u304d\u3001\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u3092\u30eb\u30fc\u30d7\u3067\u8868\u793a\u3057\u3001\u72ec\u81ea\u30af\u30a8\u30ea\u5f8c\u306f `wp_reset_postdata()` \u3067\u623b\u3057\u307e\u3059\u3002<\/p>\n<p>\u8ff7\u3063\u305f\u6642\u306f\u3001\u307e\u305a\u6700\u5c0f\u69cb\u6210\u30671\u4ef6\u3060\u3051\u53d6\u5f97\u3067\u304d\u308b\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u53d6\u5f97\u3067\u304d\u305f\u3089\u3001\u6295\u7a3f\u30bf\u30a4\u30d7\u3001\u4ef6\u6570\u3001\u4e26\u3073\u9806\u3001\u5206\u985e\u6761\u4ef6\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u6761\u4ef6\u3001\u65e5\u4ed8\u6761\u4ef6\u306e\u9806\u306b\u5c11\u3057\u305a\u3064\u5e83\u3052\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>WP_Query \u306e\u6700\u7d42\u30c1\u30a7\u30c3\u30af<\/h2><\/div><ul class=\"wpq-checklist\"><li><code>WP_Query<\/code> \u306f\u6295\u7a3f\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3060\u3068\u7406\u89e3\u3057\u3066\u3044\u308b<\/li><li><code>$args<\/code> \u306b\u53d6\u5f97\u6761\u4ef6\u3092\u66f8\u304f\u6d41\u308c\u3092\u78ba\u8a8d\u3057\u305f<\/li><li>\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u306f\u30eb\u30fc\u30d7\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f<\/li><li>\u72ec\u81ea\u30af\u30a8\u30ea\u5f8c\u306f <code>wp_reset_postdata()<\/code> \u3092\u5165\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u305f<\/li><li>\u8868\u793a\u3055\u308c\u306a\u3044\u6642\u306f\u6700\u5c0f\u69cb\u6210\u306b\u623b\u3057\u3066\u78ba\u8a8d\u3059\u308b<\/li><li><code>tax_query<\/code>\u3001<code>meta_query<\/code>\u3001<code>date_query<\/code> \u306e\u5f79\u5272\u3092\u5206\u3051\u3066\u78ba\u8a8d\u3057\u305f<\/li><\/ul><\/section>\n","protected":false},"excerpt":{"rendered":"<p>WP_Query \u306f\u3001WordPress \u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u3067\u3059\u3002\u6295\u7a3f\u30bf\u30a4\u30d7\u3001\u4ef6\u6570\u3001\u4e26\u3073\u9806\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u3001\u30bf\u30b0\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3001\u65e5\u4ed8\u306a\u3069\u306e\u6761\u4ef6\u3092\u6307\u5b9a\u3057\u3066\u4e00\u89a7\u3092\u4f5c\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":3681,"template":"","meta":{"wpq_kicker":"\u7528\u8a9e\u96c6","wpq_lead":"WP_Query \u306f\u3001WordPress \u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u4e2d\u5fc3\u7684\u306a\u4ed5\u7d44\u307f\u3067\u3059\u3002$args \u306b\u53d6\u5f97\u6761\u4ef6\u3092\u66f8\u304d\u3001\u53d6\u5f97\u3057\u305f\u6295\u7a3f\u3092\u30eb\u30fc\u30d7\u3067\u8868\u793a\u3057\u307e\u3059\u3002\u8a18\u4e8b\u4e00\u89a7\u3001\u95a2\u9023\u8a18\u4e8b\u3001\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u306e\u4e00\u89a7\u3001\u7d5e\u308a\u8fbc\u307f\u8868\u793a\u306a\u3069\u3001\u591a\u304f\u306e\u5b9f\u88c5\u3067\u4f7f\u308f\u308c\u307e\u3059\u3002","wpq_hero_title_line1":"WP_Query \u7528\u8a9e","wpq_hero_title_line2":"WP_Query","wpq_hero_title_accent":"WP_Query","wpq_hero_thumbnail_alt":"WP_Query \u306e\u6982\u8981\u30a4\u30e1\u30fc\u30b8","wpq_hero_summary_mode":"","wpq_hero_summary_label":"","wpq_hero_summary_items":"","wpq_reading_time":"","wpq_updated_label":"","wpq_official_links":"WP_Query Class|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\nwp_reset_postdata()|https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/\nThe Loop|https:\/\/developer.wordpress.org\/themes\/basics\/the-loop\/","wpq_update_history":"","wpq_pr_notice":"","footnotes":""},"wpq_glossary_group":[62],"wpq_glossary_attribute":[37],"class_list":["post-463","wpq_glossary","type-wpq_glossary","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary"}],"about":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/types\/wpq_glossary"}],"author":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":2,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/463\/revisions"}],"predecessor-version":[{"id":4027,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary\/463\/revisions\/4027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media\/3681"}],"wp:attachment":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media?parent=463"}],"wp:term":[{"taxonomy":"wpq_glossary_group","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary_group?post=463"},{"taxonomy":"wpq_glossary_attribute","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_glossary_attribute?post=463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}