{"id":3856,"date":"2026-09-07T09:00:00","date_gmt":"2026-09-07T00:00:00","guid":{"rendered":"https:\/\/wptoolslab.com\/query-lab\/?post_type=wpq_article&#038;p=3856"},"modified":"2026-09-12T19:45:30","modified_gmt":"2026-09-12T10:45:30","slug":"wp-query-date-order-not-working","status":"publish","type":"wpq_article","link":"https:\/\/wptoolslab.com\/query-lab\/articles\/wp-query-date-order-not-working\/","title":{"rendered":"WP_Query\u3067\u65e5\u4ed8\u9806\u306b\u4e26\u3070\u306a\u3044\u539f\u56e0\uff5corderby\u30fborder\u30fb\u65e5\u4ed8\u5024\u3092\u78ba\u8a8d"},"content":{"rendered":"<section class=\"conclusion wpq-conclusion\"><h2 class=\"wpq-conclusion__title\">\u6700\u521d\u306b\u300c\u3069\u306e\u65e5\u4ed8\u3092\u4e26\u3079\u305f\u3044\u304b\u300d\u3092\u6c7a\u3081\u308b<\/h2><p>WP_Query\u306f\u3001\u6295\u7a3f\u65e5\u3001\u66f4\u65b0\u65e5\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u65e5\u4ed8\u3067\u6307\u5b9a\u65b9\u6cd5\u304c\u5909\u308f\u308a\u307e\u3059\u3002\u307e\u305a\u5b9f\u969b\u306e\u65e5\u4ed8\u5024\u3092\u30bf\u30a4\u30c8\u30eb\u3068\u4e00\u7dd2\u306b\u8868\u793a\u3057\u3001\u4e26\u3079\u305f\u3044\u5024\u3068 `orderby` \u306e\u5bfe\u8c61\u304c\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6295\u7a3f\u65e5\u306f `date`\u3001\u66f4\u65b0\u65e5\u306f `modified`\u3001ACF\u306a\u3069\u306e\u72ec\u81ea\u65e5\u4ed8\u306f `meta_key` \u3068\u4fdd\u5b58\u5f62\u5f0f\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">\u6700\u521d\u306b\u4e26\u3079\u305f\u3044\u65e5\u4ed8\u30921\u3064\u306b\u6c7a\u3081\u308b\u3068\u3001\u78ba\u8a8d\u3059\u3079\u304d\u6307\u5b9a\u3092\u53d6\u308a\u9055\u3048\u307e\u305b\u3093\u3002<\/span> \u305d\u306e\u5f8c\u306b `order` \u306e\u5411\u304d\u3001\u540c\u65e5\u30c7\u30fc\u30bf\u306e\u4e8c\u6b21\u30bd\u30fc\u30c8\u3001`pre_get_posts` \u3084\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4e0a\u66f8\u304d\u30921\u3064\u305a\u3064\u5207\u308a\u5206\u3051\u307e\u3059\u3002<\/p>\n<\/section>\n<h2 id=\"symptoms\" 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\">\u75c7\u72b6\u304b\u3089\u78ba\u8a8d\u3059\u308b\u65e5\u4ed8\u3068\u6307\u5b9a\u3092\u9078\u3076<\/span><\/h2>\n<p>\u6295\u7a3f\u65e5\u6642\u3068\u3001ACF\u306a\u3069\u3067\u4f5c\u3063\u305f\u30a4\u30d9\u30f3\u30c8\u65e5\u30fb\u516c\u958b\u4e88\u5b9a\u65e5\u30fb\u958b\u50ac\u65e5\u306f\u5225\u306e\u30c7\u30fc\u30bf\u3067\u3059\u3002\u65b0\u7740\u9806\u3001\u53e4\u3044\u9806\u3001\u30a4\u30d9\u30f3\u30c8\u65e5\u9806\u306e\u3069\u308c\u304c\u9055\u3046\u304b\u3067\u78ba\u8a8d\u5148\u3092\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: \u75c7\u72b6 \/ \u6700\u521d\u306b\u7591\u3046\u539f\u56e0 \/ \u898b\u308b\u5834\u6240\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u75c7\u72b6<\/th><th>\u6700\u521d\u306b\u7591\u3046\u539f\u56e0<\/th><th>\u898b\u308b\u5834\u6240<\/th><\/tr><\/thead><tbody><tr><td>\u65b0\u7740\u9806\u306b\u306a\u3089\u306a\u3044<\/td><td>order \u3068 orderby \u306e\u6307\u5b9a\u304c\u60f3\u5b9a\u3068\u9055\u3046<\/td><td>$args \u306e orderby \/ order<\/td><\/tr><tr><td>\u53e4\u3044\u9806\u306b\u3057\u305f\u3044\u306e\u306b\u65b0\u3057\u3044\u9806\u306b\u306a\u308b<\/td><td>ASC \/ DESC \u306e\u610f\u5473\u3092\u9006\u306b\u899a\u3048\u3066\u3044\u308b<\/td><td>order \u306e\u5024<\/td><\/tr><tr><td>\u30a4\u30d9\u30f3\u30c8\u65e5\u9806\u306b\u306a\u3089\u306a\u3044<\/td><td>\u6295\u7a3f\u65e5\u6642\u3067\u4e26\u3079\u3066\u3044\u3066\u3001ACF\u306e\u65e5\u4ed8\u3092\u898b\u3066\u3044\u306a\u3044<\/td><td>meta_key \/ meta_value_num<\/td><\/tr><tr><td>\u4e00\u90e8\u3060\u3051\u9806\u756a\u304c\u5165\u308c\u66ff\u308f\u308b<\/td><td>\u540c\u3058\u65e5\u6642\u306e\u6295\u7a3f\u304c\u8907\u6570\u3042\u308a\u3001\u4e8c\u6b21\u30bd\u30fc\u30c8\u304c\u306a\u3044<\/td><td>orderby \u306e\u8907\u6570\u6307\u5b9a<\/td><\/tr><tr><td>\u30e1\u30a4\u30f3\u4e00\u89a7\u3060\u3051\u9806\u756a\u304c\u5909\u308f\u308b<\/td><td>pre_get_posts \u3084\u30c6\u30fc\u30de\u5074\u306e\u51e6\u7406\u304c\u4e0a\u66f8\u304d\u3057\u3066\u3044\u308b<\/td><td>functions.php \/ \u30d7\u30e9\u30b0\u30a4\u30f3<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<section class=\"debug-steps wpq-steps-card\"><h2>\u78ba\u8a8d\u306e\u9806\u756a<\/h2><ol class=\"step-list wpq-steps\"><li><span class=\"step-number wpq-step-no\">1<\/span><div class=\"step-body wpq-step-body\">\u6295\u7a3f\u65e5\u6642\u9806\u306a\u306e\u304b\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u65e5\u4ed8\u9806\u306a\u306e\u304b\u3092\u6c7a\u3081\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">2<\/span><div class=\"step-body wpq-step-body\">`orderby` \u3068 `order` \u3092\u6700\u5c0f\u69cb\u6210\u3067\u78ba\u8a8d\u3059\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">3<\/span><div class=\"step-body wpq-step-body\">\u540c\u3058\u65e5\u6642\u306e\u6295\u7a3f\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3059\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">4<\/span><div class=\"step-body wpq-step-body\">ACF\u306a\u3069\u306e\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u306a\u3089\u4fdd\u5b58\u5f62\u5f0f\u3068 `meta_key` \u3092\u78ba\u8a8d\u3059\u308b<\/div><\/li><li><span class=\"step-number wpq-step-no\">5<\/span><div class=\"step-body wpq-step-body\">`pre_get_posts`\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3001\u30c6\u30fc\u30de\u5074\u3067\u4e26\u3073\u66ff\u3048\u304c\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d\u3059\u308b<\/div><\/li><\/ol><\/section>\n<h2 id=\"post-date-minimum\" 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\">\u6295\u7a3f\u65e5\u6642\u3067\u4e26\u3079\u308b\u6700\u5c0f\u4f8b<\/span><\/h2>\n<p>\u307e\u305a\u306f\u6295\u7a3f\u65e5\u6642\u3067\u6b63\u3057\u304f\u4e26\u3076\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u671f\u5f85\u3069\u304a\u308a\u306b\u4e26\u3076\u306a\u3089\u3001WP_Query\u306e\u57fa\u672c\u7684\u306a\u4e26\u3073\u66ff\u3048\u306f\u52d5\u3044\u3066\u3044\u3066\u3001\u539f\u56e0\u306f\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3084\u5225\u306e\u6761\u4ef6\u306b\u3042\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3001\u516c\u958b\u6e08\u307f\u306e\u901a\u5e38\u6295\u7a3f\u3092\u6295\u7a3f\u65e5\u304c\u65b0\u3057\u3044\u9806\u306b3\u4ef6\u8868\u793a\u3057\u307e\u3059\u30022026\u5e749\u670812\u65e5\u6642\u70b9\u306eWP Query Builder\u3067\u3001\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u300cpost\u300d\u3001\u6295\u7a3f\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u300cpublish\u300d\u3001\u4ef6\u6570\u3092\u300c3\u300d\u3001\u4e26\u3073\u9806\u3092\u300cDESC\u300d\u3001\u4e26\u3073\u66ff\u3048\u3092\u300cdate\u300d\u3001\u5148\u982d\u56fa\u5b9a\u3092\u7121\u8996\u3059\u308b\u6307\u5b9a\u3092\u6709\u52b9\u306b\u3057\u3066\u751f\u6210\u3057\u305f `$args` \u3092\u305d\u306e\u307e\u307e\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u6bd4\u8f03\u3057\u3084\u3059\u3044\u3088\u3046\u3001\u81ea\u52d5\u6700\u9069\u5316\u306f\u30aa\u30d5\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>PHP\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u3046\u5b50\u30c6\u30fc\u30de\u306e `template-parts\/date-order-check.php` \u306b\u4fdd\u5b58\u3057\u3001\u8868\u793a\u3057\u305f\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30e1\u30a4\u30f3\u30eb\u30fc\u30d7\u3067 `the_post()` \u306e\u5f8c\u306b `get_template_part( &#8216;template-parts\/date-order-check&#8217; );` \u3092\u7f6e\u3044\u3066\u304f\u3060\u3055\u3044\u3002\u547c\u3073\u51fa\u3057\u5148\u304c\u3059\u3067\u306bPHP\u3068\u3057\u3066\u5b9f\u884c\u3055\u308c\u308b\u5834\u6240\u306a\u3089\u3001\u547c\u3073\u51fa\u3057\u30b3\u30fc\u30c9\u306e\u524d\u306b `&lt;?php` \u3092\u91cd\u306d\u3066\u66f8\u304f\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u6295\u7a3f\u672c\u6587\u3084\u8ffd\u52a0CSS\u3078\u306f\u8cbc\u3089\u305a\u3001\u78ba\u8a8d\u304c\u7d42\u308f\u3063\u305f\u3089\u4e0d\u8981\u306a\u547c\u3073\u51fa\u3057\u3068\u30d5\u30a1\u30a4\u30eb\u3092\u5916\u3057\u307e\u3059\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"wpq-code-context wpq-code-context--temporary\"><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>\u539f\u56e0\u3092\u5207\u308a\u5206\u3051\u308b\u305f\u3081\u306e\u4e00\u6642\u7684\u306a\u78ba\u8a8d\u30b3\u30fc\u30c9\u3067\u3059\u3002\u30ed\u30fc\u30ab\u30eb\u306a\u3069\u306e\u691c\u8a3c\u74b0\u5883\u3060\u3051\u3067\u4f7f\u3044\u3001\u78ba\u8a8d\u5f8c\u306f\u524a\u9664\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\">template-parts\/date-order-check.php<\/span><span class=\"code-purpose wpq-code-pill\">\u6295\u7a3f\u65e5\u6642\u306e\u65b0\u3057\u3044\u9806\u306b3\u4ef6\u3092\u8868\u793a\u3059\u308b\u78ba\u8a8d\u7528\u30d1\u30fc\u30c4<\/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\u65e5\u6642\u306e\u65b0\u3057\u3044\u9806\u306b3\u4ef6\u3092\u8868\u793a\u3059\u308b\u78ba\u8a8d\u7528\u30d1\u30fc\u30c4 \/ template-parts\/date-order-check.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\">$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;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\">$the_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\">$the_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;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">while<\/span> ( <span class=\"c-var\">$the_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$the_query<\/span>-&gt;the_post();&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;li&gt;&lt;a href=&quot;&#039;<\/span> . esc_url( get_permalink() ) . <span class=\"c-str\">&#039;&quot;&gt;&#039;<\/span> . esc_html( get_the_title() ) . <span class=\"c-str\">&#039;&lt;\/a&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;br&gt;\u6295\u7a3f\u65e5\u6642\uff1a&#039;<\/span> . esc_html( get_the_date( <span class=\"c-str\">&#039;Y-m-d H:i:s&#039;<\/span> ) ) . <span class=\"c-str\">&#039;&lt;\/li&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\">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;\u516c\u958b\u6e08\u307f\u306e\u6295\u7a3f\u306f\u3042\u308a\u307e\u305b\u3093\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$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;ignore_sticky_posts&#039; =&gt; true&lt;br \/&gt;\n);&lt;\/p&gt;\n&lt;p&gt;$the_query = new WP_Query( $args );&lt;\/p&gt;\n&lt;p&gt;if ( $the_query-&gt;have_posts() ) {&lt;br \/&gt;\n   echo &#039;&lt;ul&gt;&#039;;&lt;br \/&gt;\n   while ( $the_query-&gt;have_posts() ) {&lt;br \/&gt;\n      $the_query-&gt;the_post();&lt;br \/&gt;\n      echo &#039;&lt;li&gt;&lt;a href=&quot;&#039; . esc_url( get_permalink() ) . &#039;&quot;&gt;&#039; . esc_html( get_the_title() ) . &#039;&lt;\/a&gt;&#039;;&lt;br \/&gt;\n      echo &#039;&lt;br&gt;\u6295\u7a3f\u65e5\u6642\uff1a&#039; . esc_html( get_the_date( &#039;Y-m-d H:i:s&#039; ) ) . &#039;&lt;\/li&gt;&#039;;&lt;br \/&gt;\n   }&lt;br \/&gt;\n   echo &#039;&lt;\/ul&gt;&#039;;&lt;br \/&gt;\n} else {&lt;br \/&gt;\n   echo &#039;&lt;p&gt;\u516c\u958b\u6e08\u307f\u306e\u6295\u7a3f\u306f\u3042\u308a\u307e\u305b\u3093\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\u305d\u306e\u5f8c\u306e `new WP_Query()`\u3001\u65e5\u4ed8\u4ed8\u304d\u306e\u8868\u793a\u30010\u4ef6\u6642\u306e\u6587\u8a00\u3001`wp_reset_postdata()` \u306f\u3001\u7d50\u679c\u3092\u78ba\u304b\u3081\u308b\u305f\u3081\u306b\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">`DESC`\u306f\u65b0\u3057\u3044\u6295\u7a3f\u304b\u3089\u53e4\u3044\u6295\u7a3f\u3001`ASC`\u306f\u53e4\u3044\u6295\u7a3f\u304b\u3089\u65b0\u3057\u3044\u6295\u7a3f\u306e\u9806\u3067\u3059\u3002<\/span><\/p>\n<p>\u3082\u3046\u3072\u3068\u3064\u5927\u4e8b\u306a\u306e\u306f\u3001\u8868\u793a\u3059\u308b\u65e5\u4ed8\u3092\u4e00\u7dd2\u306b\u51fa\u3057\u3066\u3044\u308b\u3053\u3068\u3067\u3059\u3002\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u3092\u898b\u308b\u3068\u300c\u4e26\u3093\u3067\u3044\u306a\u3044\u300d\u3068\u611f\u3058\u3066\u3082\u3001\u5b9f\u969b\u306b\u306f\u6295\u7a3f\u65e5\u6642\u304c\u540c\u3058\u3060\u3063\u305f\u308a\u3001\u601d\u3063\u3066\u3044\u305f\u6295\u7a3f\u65e5\u3068\u9055\u3046\u5024\u304c\u5165\u3063\u3066\u3044\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305a\u306f\u753b\u9762\u306b\u65e5\u4ed8\u3092\u51fa\u3057\u3066\u3001\u30c7\u30fc\u30bf\u5074\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>`ignore_sticky_posts` \u306f\u5148\u982d\u56fa\u5b9a\u306e\u7279\u5225\u6271\u3044\u3092\u5916\u3059\u6307\u5b9a\u3067\u3001\u56fa\u5b9a\u6295\u7a3f\u305d\u306e\u3082\u306e\u3092\u9664\u5916\u3059\u308b\u6307\u5b9a\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u540c\u3058\u6295\u7a3f\u65e5\u6642\u304c\u3042\u308b\u5834\u5408\u306e\u9806\u756a\u306f\u3001\u5f8c\u534a\u306eID\u3092\u4f75\u7528\u3059\u308b\u4f8b\u3067\u56fa\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u753b\u50cf\u306f\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3092\u30ed\u30fc\u30ab\u30eb\u306e\u30b5\u30f3\u30d7\u30eb\u30b5\u30a4\u30c8\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u3067\u3059\u3002\u30bf\u30a4\u30c8\u30eb\u3060\u3051\u3067\u306a\u304f\u3001\u4e26\u3073\u66ff\u3048\u306b\u4f7f\u3063\u305f\u6295\u7a3f\u65e5\u6642\u3082\u540c\u3058\u753b\u9762\u306b\u8868\u793a\u3057\u3066\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:196 \/ 131;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/wp-query-date-order-not-working-SC-01-scaled.png\" alt=\"\u6700\u521d\u306ePHP\u3067\u8868\u793a\u3057\u305f\u901a\u5e38\u6295\u7a3f3\u4ef6\u3068\u305d\u308c\u305e\u308c\u306e\u6295\u7a3f\u65e5\u6642\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u8868\u793a\u4f8b<\/span><strong class=\"wpq-screenshot-frame__title\">\u30bf\u30a4\u30c8\u30eb\u3068\u6295\u7a3f\u65e5\u6642\u3092\u4e00\u7dd2\u306b\u898b\u308b<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u672c\u6587\u306e\u6700\u521d\u306e\u30b3\u30fc\u30c9\u3067\u30012026\u5e749\u67081\u65e510:03\u219210:02\u219210:01\u306e\u9806\u306b3\u4ef6\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u5404\u30bf\u30a4\u30c8\u30eb\u306e\u4e0b\u306b\u5b9f\u969b\u306e\u6295\u7a3f\u65e5\u6642\u3092\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p><\/figcaption><\/figure>\n\n<p>\u6295\u7a3f\u306e\u65e5\u4ed8\u3084\u30b3\u30fc\u30c9\u3092\u5909\u3048\u308b\u4f5c\u696d\u306f\u3001\u672c\u756a\u3068\u5206\u3051\u305f\u74b0\u5883\u3067\u884c\u3044\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u4e0a\u3078\u8a66\u3059\u5834\u6240\u3092\u7528\u610f\u3059\u308b\u5834\u5408\u306f\u3001Xserver\u306ePHP\u5bfe\u5fdc\u3084\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u6761\u4ef6\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<h2 id=\"custom-field-date\" class=\"h-underline section-heading\"><span class=\"section-heading-icon\" aria-hidden=\"true\"><svg data-wpq-icon=\"calendar\" 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=\"M8 2v3\" \/>\n  <path d=\"M16 2v3\" \/>\n  <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\" \/>\n  <path d=\"M3 9h18\" \/>\n  <path d=\"M8 13h.01\" \/>\n  <path d=\"M12 13h.01\" \/>\n  <path d=\"M16 13h.01\" \/>\n  <path d=\"M8 17h.01\" \/>\n  <path d=\"M12 17h.01\" \/>\n  <path d=\"M16 17h.01\" \/>\n<\/svg><\/span><span class=\"section-heading-text\">ACF\u306a\u3069\u306e\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u65e5\u4ed8\u3067\u4e26\u3079\u305f\u3044\u5834\u5408<\/span><\/h2>\n<p>\u6295\u7a3f\u65e5\u6642\u305d\u306e\u3082\u306e\u3092\u4e26\u3079\u66ff\u3048\u308b\u5834\u5408\u306f\u3001[orderby\u3068order\u306e\u57fa\u672c](..\/wp-query-orderby-order\/)\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002ACF Date Picker\u306e\u4fdd\u5b58\u5f62\u5f0f\u3068\u7d5e\u308a\u8fbc\u307f\u306f\u3001[ACF\u306e\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u7d5e\u308a\u8fbc\u3080\u65b9\u6cd5](..\/acf-date-filter\/)\u3067\u5225\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30a4\u30d9\u30f3\u30c8\u4e00\u89a7\u3084\u30bb\u30df\u30ca\u30fc\u4e00\u89a7\u3067\u306f\u3001\u6295\u7a3f\u65e5\u3067\u306f\u306a\u304f\u300c\u958b\u50ac\u65e5\u300d\u3067\u4e26\u3079\u305f\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">`orderby` \u306e `date` \u306f\u6295\u7a3f\u65e5\u6642\u3092\u8868\u3059\u305f\u3081\u3001ACF\u306e\u958b\u50ac\u65e5\u3092\u5165\u308c\u3066\u3082\u958b\u50ac\u65e5\u9806\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002<\/span><\/p>\n<p>ACF Date Picker \u306e\u3088\u3046\u306a\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u4e26\u3079\u305f\u3044\u5834\u5408\u306f\u3001\u5bfe\u8c61\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u3092 `meta_key` \u306b\u6307\u5b9a\u3057\u3001\u305d\u306e\u5024\u3067\u4e26\u3079\u307e\u3059\u3002ACF\u306eDate Picker\u306f\u3001\u8868\u793a\u5f62\u5f0f\u3084\u8fd4\u308a\u5024\u5f62\u5f0f\u3068\u306f\u5225\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u306f `Ymd` \u5f62\u5f0f\u3067\u4fdd\u5b58\u3055\u308c\u308b\u3068\u516c\u5f0f\u8cc7\u6599\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u6570\u5024\u3068\u3057\u3066\u4e26\u3079\u308b\u306a\u3089 `meta_value_num` \u3092\u4f7f\u3046\u3068\u78ba\u8a8d\u3057\u3084\u3059\u3044\u3067\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: \u78ba\u8a8d\u3059\u308b\u5024 \/ \u3053\u306e\u4f8b\u306e\u5024 \/ WP_Query\u3067\u306e\u5f79\u5272\"><table class=\"article-table table-priority wpq-article-table\"><thead><tr><th>\u78ba\u8a8d\u3059\u308b\u5024<\/th><th>\u3053\u306e\u4f8b\u306e\u5024<\/th><th>WP_Query\u3067\u306e\u5f79\u5272<\/th><\/tr><\/thead><tbody><tr><td>\u753b\u9762\u306e\u8868\u793a\u5f62\u5f0f<\/td><td>2026\u5e746\u670814\u65e5<\/td><td>\u8aad\u8005\u3078\u898b\u305b\u308b\u8868\u8a18<\/td><\/tr><tr><td>ACF\u306e\u8fd4\u308a\u5024\u5f62\u5f0f<\/td><td>2026-06-14<\/td><td>get_field()\u3067\u53d7\u3051\u53d6\u308b\u5f62\u5f0f<\/td><\/tr><tr><td>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4fdd\u5b58\u5024<\/td><td>20260614<\/td><td>meta_query\u3068\u4e26\u3073\u66ff\u3048\u304c\u6bd4\u8f03\u3059\u308b\u5024<\/td><\/tr><\/tbody><\/table><\/div><\/div>\n<p>\u30af\u30a8\u30ea\u3067\u6bd4\u8f03\u3059\u308b\u306e\u306f\u3001\u8fd4\u308a\u5024\u306e`2026-06-14`\u3067\u306f\u306a\u304f\u3001\u4fdd\u5b58\u5024\u3068\u540c\u3058`Ymd`\u5f62\u5f0f\u3067\u3059\u3002\u4eca\u65e5\u306a\u3089 `current_time( &#8216;Ymd&#8217; )` \u3067\u3001WordPress\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u8a2d\u5b9a\u306b\u57fa\u3065\u304f\u5024\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u4f8b\u306f\u3001\u958b\u50ac\u65e5\u3092\u6301\u3064\u6295\u7a3f\u30bf\u30a4\u30d7 `works` \u3092\u4f7f\u3044\u307e\u3059\u3002WP Query Builder\u306b\u306f\u3001\u6295\u7a3f\u30bf\u30a4\u30d7\u300cworks\u300d\u3001\u6295\u7a3f\u30b9\u30c6\u30fc\u30bf\u30b9\u300cpublish\u300d\u3001\u4ef6\u6570\u300c10\u300d\u3001\u4e26\u3073\u9806\u300cASC\u300d\u3001\u4e26\u3073\u66ff\u3048\u300cmeta_value_num\u300d\u3092\u5165\u529b\u3057\u3001`event_date` \u304c `20260801` \u4ee5\u4e0a\u306b\u306a\u308b\u6570\u5024\u6761\u4ef6\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002\u751f\u6210\u3055\u308c\u305f `$args` \u306f\u5909\u66f4\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u5b9f\u969b\u306b `event` \u3068\u3057\u3066\u767b\u9332\u3057\u3066\u3044\u308b\u306a\u3089\u3001`post_type` \u3092 `event` \u3078\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002`template-parts\/event-date-order.php` \u306b\u4fdd\u5b58\u3057\u3001\u5148\u307b\u3069\u3068\u540c\u3058\u8a2d\u7f6e\u6761\u4ef6\u3067 `get_template_part( &#8216;template-parts\/event-date-order&#8217; );` \u3068\u547c\u3073\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\/event-date-order.php<\/span><span class=\"code-purpose wpq-code-pill\">2026\u5e748\u67081\u65e5\u4ee5\u964d\u306e\u958b\u50ac\u65e5\u3092\u8fd1\u3044\u9806\u306b\u8868\u793a\u3059\u308b\u78ba\u8a8d\u7528\u30d1\u30fc\u30c4<\/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: 2026\u5e748\u67081\u65e5\u4ee5\u964d\u306e\u958b\u50ac\u65e5\u3092\u8fd1\u3044\u9806\u306b\u8868\u793a\u3059\u308b\u78ba\u8a8d\u7528\u30d1\u30fc\u30c4 \/ template-parts\/event-date-order.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\">$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;works&#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\">10<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">    <span class=\"c-key\">&#039;order&#039;<\/span> =&gt; <span class=\"c-str\">&#039;ASC&#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;meta_value_num&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">    <span class=\"c-key\">&#039;meta_query&#039;<\/span> =&gt; <span class=\"c-keyword\">array<\/span>(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">        <span class=\"c-keyword\">array<\/span>(&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            <span class=\"c-key\">&#039;key&#039;<\/span> =&gt; <span class=\"c-str\">&#039;event_date&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            <span class=\"c-key\">&#039;compare&#039;<\/span> =&gt; <span class=\"c-str\">&#039;&gt;=&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            <span class=\"c-key\">&#039;type&#039;<\/span> =&gt; <span class=\"c-str\">&#039;NUMERIC&#039;<\/span>,&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">            <span class=\"c-key\">&#039;value&#039;<\/span> =&gt; <span class=\"c-num\">20260801<\/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\">    <span class=\"c-key\">&#039;meta_key&#039;<\/span> =&gt; <span class=\"c-str\">&#039;event_date&#039;<\/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\">$event_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\">$event_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;br \/&gt;<\/span><span class=\"wpq-code-line\">   <span class=\"c-keyword\">while<\/span> ( <span class=\"c-var\">$event_query<\/span>-&gt;have_posts() ) {&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-var\">$event_query<\/span>-&gt;the_post();&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;li&gt;&lt;a href=&quot;&#039;<\/span> . esc_url( get_permalink() ) . <span class=\"c-str\">&#039;&quot;&gt;&#039;<\/span> . esc_html( get_the_title() ) . <span class=\"c-str\">&#039;&lt;\/a&gt;&#039;<\/span>;&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-keyword\">echo<\/span> <span class=\"c-str\">&#039;&lt;br&gt;\u958b\u50ac\u65e5\uff08\u4fdd\u5b58\u5024\uff09\uff1a&#039;<\/span> . esc_html( get_post_meta( get_the_ID(), <span class=\"c-str\">&#039;event_date&#039;<\/span>, <span class=\"c-keyword\">true<\/span> ) ) . <span class=\"c-str\">&#039;&lt;\/li&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\">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;\u6761\u4ef6\u306b\u5408\u3046\u958b\u50ac\u4e88\u5b9a\u306f\u3042\u308a\u307e\u305b\u3093\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$args = array(&lt;br \/&gt;\n    &#039;post_type&#039; =&gt; &#039;works&#039;,&lt;br \/&gt;\n    &#039;post_status&#039; =&gt; &#039;publish&#039;,&lt;br \/&gt;\n    &#039;posts_per_page&#039; =&gt; 10,&lt;br \/&gt;\n    &#039;order&#039; =&gt; &#039;ASC&#039;,&lt;br \/&gt;\n    &#039;orderby&#039; =&gt; &#039;meta_value_num&#039;,&lt;br \/&gt;\n    &#039;meta_query&#039; =&gt; array(&lt;br \/&gt;\n        array(&lt;br \/&gt;\n            &#039;key&#039; =&gt; &#039;event_date&#039;,&lt;br \/&gt;\n            &#039;compare&#039; =&gt; &#039;&gt;=&#039;,&lt;br \/&gt;\n            &#039;type&#039; =&gt; &#039;NUMERIC&#039;,&lt;br \/&gt;\n            &#039;value&#039; =&gt; 20260801&lt;br \/&gt;\n        )&lt;br \/&gt;\n    ),&lt;br \/&gt;\n    &#039;meta_key&#039; =&gt; &#039;event_date&#039;&lt;br \/&gt;\n);&lt;\/p&gt;\n&lt;p&gt;$event_query = new WP_Query( $args );&lt;\/p&gt;\n&lt;p&gt;if ( $event_query-&gt;have_posts() ) {&lt;br \/&gt;\n   echo &#039;&lt;ul&gt;&#039;;&lt;br \/&gt;\n   while ( $event_query-&gt;have_posts() ) {&lt;br \/&gt;\n      $event_query-&gt;the_post();&lt;br \/&gt;\n      echo &#039;&lt;li&gt;&lt;a href=&quot;&#039; . esc_url( get_permalink() ) . &#039;&quot;&gt;&#039; . esc_html( get_the_title() ) . &#039;&lt;\/a&gt;&#039;;&lt;br \/&gt;\n      echo &#039;&lt;br&gt;\u958b\u50ac\u65e5\uff08\u4fdd\u5b58\u5024\uff09\uff1a&#039; . esc_html( get_post_meta( get_the_ID(), &#039;event_date&#039;, true ) ) . &#039;&lt;\/li&gt;&#039;;&lt;br \/&gt;\n   }&lt;br \/&gt;\n   echo &#039;&lt;\/ul&gt;&#039;;&lt;br \/&gt;\n} else {&lt;br \/&gt;\n   echo &#039;&lt;p&gt;\u6761\u4ef6\u306b\u5408\u3046\u958b\u50ac\u4e88\u5b9a\u306f\u3042\u308a\u307e\u305b\u3093\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>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001`event_date`\u3092\u4e26\u3073\u66ff\u3048\u5bfe\u8c61\u306b\u3057\u3001\u4fdd\u5b58\u5024\u304c `20260801` \u4ee5\u4e0a\u306e\u6295\u7a3f\u3060\u3051\u306b\u7d5e\u3063\u3066\u3044\u307e\u3059\u3002Builder\u304c\u751f\u6210\u3057\u305f\u306e\u306f `$args` \u307e\u3067\u3067\u3001\u8868\u793a\u30eb\u30fc\u30d7\u30680\u4ef6\u6642\u306e\u6587\u8a00\u3001\u30ea\u30bb\u30c3\u30c8\u306f\u624b\u52d5\u3067\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u904b\u7528\u3067\u300c\u4eca\u65e5\u4ee5\u964d\u300d\u306b\u3059\u308b\u5834\u5408\u306f\u3001\u751f\u6210\u30b3\u30fc\u30c9\u306e `20260801` \u3060\u3051\u3092 `(int) current_time( &#8216;Ymd&#8217; )` \u3078\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<span class=\"wpq-marker wpq-marker--yellow\">\u52d5\u7684\u306a\u4eca\u65e5\u306e\u65e5\u4ed8\u306fBuilder\u306e\u5165\u529b\u5024\u3067\u306f\u306a\u304f\u3001WordPress\u306e\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u4f7f\u3046\u305f\u3081\u306b\u624b\u52d5\u3067\u52a0\u3048\u308b\u90e8\u5206\u3067\u3059\u3002<\/span> \u540c\u3058\u958b\u50ac\u65e5\u306e\u9806\u756a\u307e\u3067\u56fa\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u5f8c\u534a\u306e\u8907\u6570\u6307\u5b9a\u3068\u540c\u3058\u8003\u3048\u65b9\u3067\u4e8c\u6b21\u30bd\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u305a\u304d\u3084\u3059\u3044\u306e\u306f\u3001ACF\u306e\u300c\u8868\u793a\u5f62\u5f0f\u300d\u3084\u300c\u8fd4\u308a\u5024\u5f62\u5f0f\u300d\u3092\u898b\u3066\u3001\u4fdd\u5b58\u5024\u3082\u540c\u3058\u3060\u3068\u601d\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u3067\u3059\u3002\u5b9f\u969b\u306bWP_Query\u304c\u6bd4\u8f03\u3059\u308b\u306e\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308bpost meta\u3067\u3059\u3002\u753b\u9762\u8868\u793a\u306e`2026\u5e746\u670814\u65e5`\u3001\u8fd4\u308a\u5024\u306e`2026-06-14`\u3001\u4fdd\u5b58\u5024\u306e`20260614`\u3092\u5225\u3005\u306b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306e\u5b9f\u753b\u9762\u3067\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u30682\u3064\u306e\u8868\u793a\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002\u4fdd\u5b58\u5024\u306f\u753b\u9762\u306e\u8868\u793a\u5f62\u5f0f\u3068\u306f\u5225\u306a\u306e\u3067\u3001\u8a18\u4e8b\u5185\u306e\u4e00\u89a7\u3067\u306f `get_post_meta()` \u306e\u5024\u3082\u4f75\u8a18\u3057\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:1374 \/ 845;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/wp-query-date-order-not-working-SC-02-scaled.png\" alt=\"\u533f\u540d\u306e\u691c\u8a3c\u74b0\u5883\u306b\u3042\u308bACF Date Picker\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u3001\u8868\u793a\u5f62\u5f0f\u3001\u8fd4\u308a\u5024\u5f62\u5f0f\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">ACF Date Picker<\/span><strong class=\"wpq-screenshot-frame__title\">\u8868\u793a\u5f62\u5f0f\u30fb\u8fd4\u308a\u5024\u30fb\u4fdd\u5b58\u5024\u3092\u5206\u3051\u3066\u78ba\u8a8d<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u306fevent_date\u3001\u753b\u9762\u8868\u793a\u306fY\u5e74m\u6708d\u65e5\u3001\u8fd4\u308a\u5024\u306fY-m-d\u3067\u3059\u3002WP_Query\u304c\u6bd4\u8f03\u3059\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4fdd\u5b58\u5024\u306fYmd\u5f62\u5f0f\u3067\u3059\u3002<\/p><\/figcaption><\/figure>\n<h3 id=\"event-date-results\" class=\"wpq-subheading\">\u540c\u3058\u4fdd\u5b58\u5024\u3067\u3001\u65e5\u4ed8\u306e\u4e0b\u9650\u3068\u4e26\u3073\u9806\u3092\u898b\u308b<\/h3>\n<p>\u6b21\u306e\u753b\u50cf\u3067\u306f\u3001\u4fdd\u5b58\u5024\u304c `20260712`\u30fb`20260812`\u30fb`20260905` \u306e3\u4ef6\u306b\u3001\u4e0a\u306eBuilder\u751f\u6210\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u5b9f\u884c\u3057\u307e\u3057\u305f\u30028\u670812\u65e5\u30019\u67085\u65e5\u306e\u9806\u306b\u306a\u308a\u30017\u670812\u65e5\u306f\u5bfe\u8c61\u304b\u3089\u5916\u308c\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:490 \/ 277;\"><img decoding=\"async\" src=\"https:\/\/wptoolslab.com\/query-lab\/wp-content\/uploads\/2026\/09\/wp-query-date-order-not-working-SC-03-scaled.png\" alt=\"2026\u5e748\u67081\u65e5\u4ee5\u964d\u306e\u6761\u4ef6\u3067\u3001\u590f\u306e\u5236\u4f5c\u76f8\u8ac7\u4f1a20260812\u3001\u79cb\u306eWP_Query\u52c9\u5f37\u4f1a20260905\u306e\u9806\u306b\u4e26\u3076\u30b5\u30a4\u30c8\" loading=\"lazy\" \/><\/span><figcaption class=\"wpq-screenshot-frame__caption\"><span class=\"wpq-screenshot-frame__eyebrow\">\u958b\u50ac\u65e5\u306e\u8868\u793a\u4f8b<\/span><strong class=\"wpq-screenshot-frame__title\">\u57fa\u6e96\u65e5\u4ee5\u964d\u3092\u3001\u958b\u50ac\u65e5\u306e\u8fd1\u3044\u9806\u306b\u4e26\u3079\u308b<\/strong><p class=\"wpq-screenshot-frame__caption-text\">\u57fa\u6e96\u65e5\u309220260801\u306b\u56fa\u5b9a\u3057\u305f\u4f8b\u3067\u3059\u3002\u5bfe\u8c612\u4ef6\u306f20260812\u219220260905\u306e\u9806\u3002\u5b9f\u904b\u7528\u3067\u306f\u5024\u3092current_time(&#039;Ymd&#039;)\u3078\u7f6e\u304d\u63db\u3048\u3001\u65e5\u4ed8\u7d4c\u904e\u3067\u5bfe\u8c61\u304c\u6e1b\u308b\u3053\u3068\u3082\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p><\/figcaption><\/figure>\n<p>\u3053\u306e3\u4ef6\u3060\u3051\u306a\u3089\u30012026\u5e749\u67086\u65e5\u4ee5\u964d\u306f0\u4ef6\u3067\u3059\u3002\u300c\u6761\u4ef6\u306b\u5408\u3046\u958b\u50ac\u4e88\u5b9a\u306f\u3042\u308a\u307e\u305b\u3093\u300d\u3068\u51fa\u308b\u306e\u306f\u65e5\u4ed8\u6761\u4ef6\u306b\u5408\u3046\u6295\u7a3f\u304c\u306a\u3044\u305f\u3081\u3067\u3001\u4e26\u3073\u66ff\u3048\u306e\u5931\u6557\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u65e5\u4ed8\u672a\u4fdd\u5b58\u3084\u7a7a\u6587\u5b57\u306e\u6295\u7a3f\u3082\u3001\u3053\u306e\u6570\u5024\u306e\u4e0b\u9650\u6761\u4ef6\u306b\u306f\u5165\u308a\u307e\u305b\u3093\u3002<\/p>\n<h2 id=\"cause-details\" 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\">\u539f\u56e0\u3054\u3068\u306e\u5207\u308a\u5206\u3051\u30dd\u30a4\u30f3\u30c8<\/span><\/h2>\n<p>\u8868\u793a\u4ef6\u6570\u30923\u4ef6\u7a0b\u5ea6\u306b\u3057\u3001\u65e5\u4ed8\u5024\u3092\u753b\u9762\u3078\u51fa\u3057\u307e\u3059\u3002`post_type`\u3001`meta_query`\u3001`tax_query`\u3001\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3001\u4e26\u3073\u9806\u306f1\u3064\u305a\u3064\u623b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3 id=\"wrong-order\" class=\"wpq-subheading\">1. ASC \u3068 DESC \u306e\u5411\u304d\u3092\u9006\u306b\u899a\u3048\u3066\u3044\u308b<\/h3>\n<p>`ASC` \u306f\u5c0f\u3055\u3044\u5024\u304b\u3089\u5927\u304d\u3044\u5024\u3078\u3001`DESC` \u306f\u5927\u304d\u3044\u5024\u304b\u3089\u5c0f\u3055\u3044\u5024\u3078\u4e26\u3079\u307e\u3059\u3002\u65e5\u4ed8\u306e\u5834\u5408\u3001\u65b0\u3057\u3044\u65e5\u4ed8\u307b\u3069\u5024\u304c\u5927\u304d\u304f\u306a\u308b\u305f\u3081\u3001\u65b0\u7740\u9806\u306f\u57fa\u672c\u7684\u306b `DESC`\u3001\u53e4\u3044\u9806\u306f `ASC` \u3067\u3059\u3002<\/p>\n<p>\u30a4\u30d9\u30f3\u30c8\u65e5\u9806\u3067\u306f\u5c11\u3057\u611f\u899a\u304c\u5909\u308f\u308a\u307e\u3059\u3002\u4eca\u65e5\u4ee5\u964d\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u8fd1\u3044\u9806\u306b\u8868\u793a\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u904e\u53bb\u65e5\u3092\u9664\u5916\u3057\u305f\u3046\u3048\u3067 `ASC` \u306b\u3057\u307e\u3059\u3002\u904e\u53bb\u65e5\u3092\u9664\u5916\u3057\u306a\u3044\u307e\u307e `ASC` \u306b\u3059\u308b\u3068\u3001\u53e4\u3044\u30a4\u30d9\u30f3\u30c8\u304c\u5148\u982d\u306b\u51fa\u3066\u300c\u8fd1\u3044\u9806\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u300d\u3068\u611f\u3058\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"wrong-orderby\" class=\"wpq-subheading\">2. \u4e26\u3079\u305f\u3044\u65e5\u4ed8\u3068 orderby \u306e\u5bfe\u8c61\u304c\u9055\u3046<\/h3>\n<p>`orderby =&gt; &#8216;date&#8217;` \u306f\u6295\u7a3f\u65e5\u6642\u3001`orderby =&gt; &#8216;modified&#8217;` \u306f\u66f4\u65b0\u65e5\u6642\u3067\u3059\u3002\u30a4\u30d9\u30f3\u30c8\u65e5\u3084\u7de0\u5207\u65e5\u306a\u3069\u3001\u72ec\u81ea\u306b\u4f5c\u3063\u305f\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>`date_query`\u306f\u6295\u7a3f\u65e5\u6642\u306a\u3069\u3092\u671f\u9593\u3067\u7d5e\u308a\u8fbc\u3080\u305f\u3081\u306e\u6307\u5b9a\u3067\u3001\u4e26\u3073\u66ff\u3048\u57fa\u6e96\u3092\u9078\u3076`orderby`\u306e\u4ee3\u308f\u308a\u306b\u306f\u306a\u308a\u307e\u305b\u3093\u3002\u300c\u4eca\u5e74\u306e\u8a18\u4e8b\u3060\u3051\u3092\u65b0\u3057\u3044\u9806\u306b\u3059\u308b\u300d\u306a\u3089\u3001`date_query`\u3067\u5bfe\u8c61\u671f\u9593\u3092\u7d5e\u308a\u3001`orderby =&gt; &#8216;date&#8217;`\u3068`order =&gt; &#8216;DESC&#8217;`\u3067\u9806\u756a\u3092\u6c7a\u3081\u307e\u3059\u3002<\/p>\n<p>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u65e5\u4ed8\u3067\u4e26\u3079\u308b\u306a\u3089\u3001`meta_key` \u3068 `orderby =&gt; &#8216;meta_value&#8217;` \u307e\u305f\u306f `meta_value_num` \u3092\u4f7f\u3044\u307e\u3059\u3002\u65e5\u4ed8\u306e\u4fdd\u5b58\u5f62\u5f0f\u306b\u3088\u3063\u3066\u5411\u3044\u3066\u3044\u308b\u6307\u5b9a\u304c\u5909\u308f\u308b\u305f\u3081\u3001\u307e\u305a\u306f\u5b9f\u969b\u306e\u4fdd\u5b58\u5024\u3092 `get_post_meta()` \u3067\u8868\u793a\u3057\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001`meta_key`\u3084`meta_query`\u3092\u4f7f\u3046\u4e26\u3073\u66ff\u3048\u3067\u306f\u3001\u305d\u306e\u30ad\u30fc\u304c\u672a\u4fdd\u5b58\u306e\u6295\u7a3f\u306f\u901a\u5e38\u306e\u7d50\u679c\u304b\u3089\u5916\u308c\u307e\u3059\u3002\u300c\u65e5\u4ed8\u672a\u5165\u529b\u3092\u6700\u5f8c\u306b\u56de\u3057\u305f\u3044\u300d\u5834\u5408\u306f\u3001\u672a\u5165\u529b\u3092\u542b\u3081\u308b\u6761\u4ef6\u3068\u4e26\u3073\u9806\u3092\u5225\u9014\u8a2d\u8a08\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3 id=\"same-date\" class=\"wpq-subheading\">3. \u540c\u3058\u65e5\u6642\u306e\u6295\u7a3f\u304c\u591a\u304f\u3001\u9806\u756a\u304c\u5b89\u5b9a\u3057\u3066\u898b\u3048\u306a\u3044<\/h3>\n<p>\u8907\u6570\u306e\u8a18\u4e8b\u304c\u540c\u3058\u6295\u7a3f\u65e5\u6642\u3001\u307e\u305f\u306f\u540c\u3058\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u5024\u3092\u6301\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u4e2d\u306e\u9806\u756a\u304c\u671f\u5f85\u3068\u9055\u3063\u3066\u898b\u3048\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u65e5\u4ed8\u3060\u3051\u3067\u306f\u9806\u756a\u3092\u4e00\u610f\u306b\u6c7a\u3081\u3089\u308c\u306a\u3044\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u5834\u5408\u306f\u3001\u65e5\u4ed8\u306b\u52a0\u3048\u3066 `ID` \u306a\u3069\u306e\u4e8c\u6b21\u30bd\u30fc\u30c8\u3092\u4f7f\u3046\u3068\u3001\u78ba\u8a8d\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u6295\u7a3f\u65e5\u304c\u540c\u3058\u3082\u306e\u306fID\u306e\u5927\u304d\u3044\u9806\u306b\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u3088\u3046\u306b\u88dc\u52a9\u7684\u306a\u4e26\u3073\u9806\u3092\u8db3\u3057\u307e\u3059\u3002<\/p>\n<p>\u6700\u521d\u306e `date-order-check.php` \u306e `$args` \u5168\u4f53\u3092\u6b21\u3078\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002\u5f8c\u308d\u306e\u8868\u793a\u30eb\u30fc\u30d7\u3068\u30ea\u30bb\u30c3\u30c8\u306f\u305d\u306e\u307e\u307e\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<div class=\"code-panel wpq-code-block\"><div class=\"wpq-code-context wpq-code-context--excerpt\"><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>\u5f15\u6570\u3084\u51e6\u7406\u306e\u4e00\u90e8\u5206\u3060\u3051\u3092\u793a\u3057\u305f\u4f8b\u3067\u3059\u3002\u3053\u306e\u307e\u307e\u5358\u72ec\u3067\u8cbc\u3089\u305a\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5185\u306eWP_Query\u3068\u30eb\u30fc\u30d7\u3078\u7d44\u307f\u8fbc\u3093\u3067\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\">date-order-with-id.php<\/span><span class=\"code-purpose wpq-code-pill\">\u540c\u3058\u6295\u7a3f\u65e5\u304c\u3042\u308b\u6642\u306b\u3001\u65e5\u4ed8\u9806\u306b\u52a0\u3048\u3066ID\u9806\u3082\u6307\u5b9a\u3059\u308b$args\u5dee\u5206<\/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: \u540c\u3058\u6295\u7a3f\u65e5\u304c\u3042\u308b\u6642\u306b\u3001\u65e5\u4ed8\u9806\u306b\u52a0\u3048\u3066ID\u9806\u3082\u6307\u5b9a\u3059\u308b$args\u5dee\u5206 \/ date-order-with-id.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\">   <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\">   <span class=\"c-key\">&#039;orderby&#039;<\/span>        =&gt; [&lt;br \/&gt;<\/span><span class=\"wpq-code-line\">      <span class=\"c-key\">&#039;date&#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;ID&#039;<\/span>   =&gt; <span class=\"c-str\">&#039;DESC&#039;<\/span>,&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;\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   &#039;ignore_sticky_posts&#039; =&gt; true,&lt;br \/&gt;\n   &#039;orderby&#039;        =&gt; [&lt;br \/&gt;\n      &#039;date&#039; =&gt; &#039;DESC&#039;,&lt;br \/&gt;\n      &#039;ID&#039;   =&gt; &#039;DESC&#039;,&lt;br \/&gt;\n   ],&lt;br \/&gt;\n];&lt;br \/&gt;<\/textarea><\/div>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u3001`orderby`\u3092\u914d\u5217\u3067\u6307\u5b9a\u3057\u3066\u3044\u308b\u70b9\u3067\u3059\u3002\u307e\u305a\u6295\u7a3f\u65e5\u3067\u65b0\u3057\u3044\u9806\u306b\u4e26\u3079\u3001\u540c\u3058\u6295\u7a3f\u65e5\u306e\u4e2d\u3067\u306fID\u304c\u5927\u304d\u3044\u3082\u306e\u3092\u5148\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u3067\u300c\u540c\u3058\u65e5\u4ed8\u306e\u4e2d\u3060\u3051\u9806\u756a\u304c\u6bce\u56de\u9055\u3046\u3088\u3046\u306b\u898b\u3048\u308b\u300d\u72b6\u614b\u3092\u6e1b\u3089\u305b\u307e\u3059\u3002<\/p>\n\n<p>\u4e26\u3079\u308b\u65e5\u4ed8\u3068\u5411\u304d\u304c\u6c7a\u307e\u3063\u305f\u3089\u3001WP Query Builder\u3067\u53d6\u5f97\u6761\u4ef6\u3092\u6574\u7406\u3067\u304d\u307e\u3059\u3002\u751f\u6210\u3057\u305f$args\u3092\u8868\u793a\u30eb\u30fc\u30d7\u3078\u6e21\u3059\u5834\u5408\u3082\u3001\u4eca\u65e5\u306e\u65e5\u4ed8\u306e\u53d6\u5f97\u3084\u540c\u65e5\u6642\u306eID\u9806\u306f\u8981\u4ef6\u306b\u5408\u308f\u305b\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\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>\u65e5\u4ed8\u306e\u53d6\u5f97\u6761\u4ef6\u3092\u7d44\u307f\u7acb\u3066\u308b<\/h3><p>\u6295\u7a3f\u30bf\u30a4\u30d7\u30fb\u65e5\u4ed8\u6761\u4ef6\u30fb\u4e26\u3073\u9806\u304b\u3089$args\u3092\u4f5c\u308c\u307e\u3059\u3002\u4fdd\u5b58\u5024\u306e\u78ba\u8a8d\u3068\u3001\u65e5\u4ed8\u4ed8\u304d\u306e\u8868\u793a\u30eb\u30fc\u30d7\u306fWordPress\u5074\u3067\u884c\u3044\u307e\u3059\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<h3 id=\"overwritten-query\" class=\"wpq-subheading\">4. pre_get_posts \u3084\u5225\u306e\u51e6\u7406\u3067\u4e0a\u66f8\u304d\u3055\u308c\u3066\u3044\u308b<\/h3>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u66f8\u3044\u305f `$args` \u304c\u6b63\u3057\u304f\u3066\u3082\u3001\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092 `pre_get_posts` \u3067\u5909\u66f4\u3057\u3066\u3044\u305f\u308a\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3084\u30c6\u30fc\u30de\u5074\u304c\u4e26\u3073\u9806\u3092\u5909\u3048\u3066\u3044\u305f\u308a\u3059\u308b\u3068\u3001\u610f\u56f3\u3057\u305f\u9806\u756a\u306b\u306a\u3089\u306a\u3044\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u7279\u306b\u30a2\u30fc\u30ab\u30a4\u30d6\u30da\u30fc\u30b8\u3084\u691c\u7d22\u7d50\u679c\u30da\u30fc\u30b8\u3067\u306f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5185\u306e\u30b5\u30d6\u30af\u30a8\u30ea\u3068\u3001WordPress\u304c\u6700\u521d\u304b\u3089\u6301\u3063\u3066\u3044\u308b\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u6df7\u540c\u3057\u3084\u3059\u3044\u3067\u3059\u3002\u3069\u3061\u3089\u306e\u30af\u30a8\u30ea\u3092\u76f4\u3057\u3066\u3044\u308b\u306e\u304b\u3092\u5206\u3051\u3066\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30b5\u30d6\u30af\u30a8\u30ea\u3092\u4f7f\u3046\u306a\u3089 `new WP_Query()` \u306e\u7d50\u679c\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u304b\u3001\u30e1\u30a4\u30f3\u30af\u30a8\u30ea\u3092\u5909\u3048\u308b\u306a\u3089 `pre_get_posts` \u306e\u6761\u4ef6\u5206\u5c90\u304c\u9069\u5207\u304b\u3092\u898b\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3 id=\"reset-postdata\" class=\"wpq-subheading\">5. \u5225\u30eb\u30fc\u30d7\u306e\u6295\u7a3f\u30c7\u30fc\u30bf\u304c\u6b8b\u3063\u3066\u3044\u308b<\/h3>\n<p>\u8907\u6570\u306eWP_Query\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u30eb\u30fc\u30d7\u5f8c\u306b `wp_reset_postdata()` \u3092\u547c\u3070\u306a\u3044\u3068\u3001\u305d\u306e\u5f8c\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u304c\u5225\u30eb\u30fc\u30d7\u306e\u6295\u7a3f\u3092\u53c2\u7167\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u4e26\u3073\u9806\u305d\u306e\u3082\u306e\u3092\u5909\u3048\u308b\u539f\u56e0\u3068\u3044\u3046\u3088\u308a\u3001\u300c\u9055\u3046\u8a18\u4e8b\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u300d\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p>\u65e5\u4ed8\u9806\u306e\u78ba\u8a8d\u4e2d\u306b\u3001\u30bf\u30a4\u30c8\u30eb\u3084\u65e5\u4ed8\u306e\u8868\u793a\u304c\u60f3\u5b9a\u3068\u30ba\u30ec\u308b\u5834\u5408\u306f\u3001\u30eb\u30fc\u30d7\u5f8c\u306b `wp_reset_postdata()` \u304c\u3042\u308b\u304b\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002WordPress\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u306e\u6a19\u6e96\u30eb\u30fc\u30d7\u4f8b\u3067\u3082\u3001\u5225\u30af\u30a8\u30ea\u306e\u30eb\u30fc\u30d7\u5f8c\u306b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3059\u51e6\u7406\u304c\u793a\u3055\u308c\u3066\u3044\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=\"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\">\u65e5\u4ed8\u9806\u306b\u95a2\u308f\u308bWP_Query\u306e\u516c\u5f0f\u8cc7\u6599<\/span><\/h2>\n<p>WP_Query\u306e\u65e5\u4ed8\u9806\u306f\u3001`orderby` \u3068 `order` \u3060\u3051\u3067\u306a\u304f\u3001Date Parameters\u3001Custom Field Parameters\u3001\u30eb\u30fc\u30d7\u5f8c\u306e\u6295\u7a3f\u30c7\u30fc\u30bf\u30ea\u30bb\u30c3\u30c8\u3068\u3082\u95a2\u4fc2\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u6271\u3063\u305f\u78ba\u8a8d\u30dd\u30a4\u30f3\u30c8\u3092\u516c\u5f0f\u8cc7\u6599\u3067\u898b\u308b\u6642\u306f\u3001\u6b21\u306e\u30da\u30fc\u30b8\u3092\u958b\u304f\u3068\u5bfe\u5fdc\u7b87\u6240\u3092\u8ffd\u3044\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p>ACF Date Picker\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001WordPress\u5074\u306e\u8cc7\u6599\u3060\u3051\u3067\u306a\u304f\u3001ACF\u5074\u306e\u4fdd\u5b58\u5f62\u5f0f\u3082\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8868\u793a\u5f62\u5f0f\u3084\u8fd4\u308a\u5024\u5f62\u5f0f\u3092\u5909\u3048\u3066\u3082\u3001WP_Query\u304c\u6bd4\u8f03\u3059\u308b\u4fdd\u5b58\u5024\u306e\u8003\u3048\u65b9\u3092\u62bc\u3055\u3048\u3066\u304a\u304f\u3068\u3001\u65e5\u4ed8\u9806\u306e\u30c8\u30e9\u30d6\u30eb\u3092\u6e1b\u3089\u305b\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\">orderby\u3001order\u3001Date Parameters\u3001Custom Field Parameters\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_date_query\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">WP_Date_Query<\/strong><span class=\"wpq-reference-item__description\">date_query\u3067\u6295\u7a3f\u65e5\u6642\u306e\u7bc4\u56f2\u3092\u6271\u3046\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\">\u5225\u30af\u30a8\u30ea\u306e\u30eb\u30fc\u30d7\u5f8c\u306b\u6295\u7a3f\u30c7\u30fc\u30bf\u3092\u623b\u3059\u7406\u7531\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:\/\/www.advancedcustomfields.com\/resources\/date-picker\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span class=\"wpq-reference-item__copy\"><strong class=\"wpq-reference-item__title\">ACF Date Picker<\/strong><span class=\"wpq-reference-item__description\">ACF\u306e\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4fdd\u5b58\u5f62\u5f0f\u3068\u4e26\u3073\u66ff\u3048\u4f8b\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<h2 id=\"final-check\" 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\">\u6700\u5f8c\u306b\u78ba\u8a8d\u3057\u305f\u3044\u3053\u3068<\/span><\/h2>\n<p>\u4e26\u3079\u305f\u3044\u65e5\u4ed8\u3001\u5411\u304d\u3001\u8868\u793a\u3057\u3066\u3044\u308b\u30eb\u30fc\u30d7\u3001\u4fdd\u5b58\u5024\u3092\u5206\u3051\u307e\u3059\u3002\u6295\u7a3f\u65e5\u9806\u3060\u3051\u5408\u3046\u306e\u304b\u3001\u904e\u53bb\u65e5\u3060\u3051\u6df7\u3058\u308b\u306e\u304b\u3001\u540c\u65e5\u306e\u4e2d\u3060\u3051\u4e0d\u5b89\u5b9a\u306a\u306e\u304b\u3092\u78ba\u8a8d\u3059\u308c\u3070\u3001`orderby`\u3001`meta_key`\u3001\u4fdd\u5b58\u5f62\u5f0f\u306e\u3069\u3053\u3092\u76f4\u3059\u304b\u5224\u65ad\u3067\u304d\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>\u65e5\u4ed8\u9806\u306e\u6700\u7d42\u5224\u65ad<\/h2><\/div><ul class=\"wpq-checklist\"><li>\u4e26\u3073\u66ff\u3048\u308b\u65e5\u4ed8\u304c\u6295\u7a3f\u65e5\u30fb\u66f4\u65b0\u65e5\u30fbACF\u306e\u3069\u308c\u304b\u6c7a\u307e\u3063\u3066\u3044\u308b<\/li><li>\u540c\u65e5\u30c7\u30fc\u30bf\u306e\u4e8c\u6b21\u30bd\u30fc\u30c8\u307e\u3067\u8981\u4ef6\u306b\u542b\u3081\u305f<\/li><li>ACF\u65e5\u4ed8\u3067\u306f\u4fdd\u5b58\u5024\u306e\u5f62\u5f0f\u3068orderby\u65b9\u5f0f\u3092\u63c3\u3048\u305f<\/li><li>\u5225\u51e6\u7406\u306e\u4e0a\u66f8\u304d\u6709\u7121\u3092\u6700\u5c0f\u4f8b\u3068\u306e\u5dee\u3067\u5224\u65ad\u3057\u305f<\/li><li>\u5909\u66f4\u524d\u5f8c\u306e\u6295\u7a3fID\u9806\u3092\u6bd4\u8f03\u3057\u305f<\/li><\/ul><\/section>\n","protected":false},"excerpt":{"rendered":"<p>WP_Query\u3067\u65e5\u4ed8\u9806\u306b\u4e26\u3070\u306a\u3044\u6642\u306f\u3001\u307e\u305a\u6295\u7a3f\u65e5\u30fb\u66f4\u65b0\u65e5\u30fbACF\u306a\u3069\u306e\u72ec\u81ea\u65e5\u4ed8\u306e\u3069\u308c\u3092\u4e26\u3079\u305f\u3044\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002orderby\u3001order\u3001\u4fdd\u5b58\u5024\u3001\u540c\u65e5\u30c7\u30fc\u30bf\u3001\u30af\u30a8\u30ea\u4e0a\u66f8\u304d\u3092\u9806\u306b\u5207\u308a\u5206\u3051\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"template":"","meta":{"wpq_kicker":"\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c8","wpq_lead":"\u300c\u65b0\u7740\u9806\u306b\u3057\u305f\u3044\u306e\u306b\u53e4\u3044\u8a18\u4e8b\u304c\u5148\u306b\u51fa\u308b\u300d\u300c\u6295\u7a3f\u65e5\u9806\u306b\u306f\u306a\u308b\u304c\u30a4\u30d9\u30f3\u30c8\u958b\u50ac\u65e5\u9806\u306b\u306a\u3089\u306a\u3044\u300d\u5834\u5408\u306f\u3001\u753b\u9762\u306b\u65e5\u4ed8\u5024\u3092\u51fa\u3057\u3066\u57fa\u6e96\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u6295\u7a3f\u65e5\u306a\u3089date\u3001\u66f4\u65b0\u65e5\u306a\u3089modified\u3001ACF\u306a\u3069\u306e\u72ec\u81ea\u65e5\u4ed8\u306a\u3089meta_key\u3068\u4fdd\u5b58\u5024\u3092\u898b\u307e\u3059\u3002","wpq_hero_title_line1":"","wpq_hero_title_line2":"","wpq_hero_title_accent":"","wpq_hero_thumbnail_alt":"WP_Query\u3067\u65e5\u4ed8\u9806\u306b\u4e26\u3070\u306a\u3044\u539f\u56e0\uff5corderby\u30fborder\u30fb\u65e5\u4ed8\u5024\u3092\u78ba\u8a8d \u306e\u30d2\u30fc\u30ed\u30fc\u30b5\u30e0\u30cd\u30a4\u30eb","wpq_hero_summary_mode":"","wpq_hero_summary_label":"\u4e26\u3079\u308b\u65e5\u4ed8\u3092\u78ba\u8a8d","wpq_hero_summary_items":"`date`::\u6295\u7a3f\u65e5\n`meta_value_num`::\u72ec\u81ea\u65e5\u4ed8","wpq_reading_time":"","wpq_difficulty_label":"","wpq_difficulty_stars":"3","wpq_target_audience":"WP_Query\u3067\u65b0\u7740\u9806\u30fb\u53e4\u3044\u9806\u30fb\u30a4\u30d9\u30f3\u30c8\u65e5\u9806\u306b\u4e26\u3079\u305f\u3044\u304c\u3001\u671f\u5f85\u3057\u305f\u9806\u756a\u306b\u306a\u3089\u305a\u56f0\u3063\u3066\u3044\u308bWordPress\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 Class|https:\/\/developer.wordpress.org\/reference\/classes\/wp_query\/\nWP_Date_Query|https:\/\/developer.wordpress.org\/reference\/classes\/wp_date_query\/\nwp_reset_postdata()|https:\/\/developer.wordpress.org\/reference\/functions\/wp_reset_postdata\/\nACF Date Picker|https:\/\/www.advancedcustomfields.com\/resources\/date-picker\/","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":[15],"tags":[109,18,93,92],"wpq_card_label":[5],"wpq_difficulty":[12],"class_list":["post-3856","wpq_article","type-wpq_article","status-publish","hentry","category-troubleshooting","tag-date_query","tag-meta_query","tag-order","tag-orderby"],"_links":{"self":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/3856","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\/3856\/revisions"}],"predecessor-version":[{"id":4053,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_article\/3856\/revisions\/4053"}],"wp:attachment":[{"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/media?parent=3856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/categories?post=3856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/tags?post=3856"},{"taxonomy":"wpq_card_label","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_card_label?post=3856"},{"taxonomy":"wpq_difficulty","embeddable":true,"href":"https:\/\/wptoolslab.com\/query-lab\/wp-json\/wp\/v2\/wpq_difficulty?post=3856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}