【发布时间】:2016-08-13 09:19:47
【问题描述】:
我的计划是制作一个日期搜索表单,但我需要在搜索时查询发布日期,因为例如如果我搜索 8 月 13 日,它将不会显示任何内容,
我如何搜索帖子的发布日期
我正在使用此代码但没有任何反应我尝试阅读这篇文章https://developer.wordpress.org/reference/functions/query_posts/,我非常抱歉我是 wordpress 和 php 的新手,学习谢谢。我认为这是错误的
<?php
global $wp_query;
$args = array_merge( $wp_query->query, array( 'posts_per_page' => 12,
'year' => $current_year,
'monthnum' => $current_month,
'order' => 'ASC' ) );
query_posts( $args );
$x = 0;
while (have_posts()) : the_post(); ?>
这是我的普通搜索
<?php
global $wp_query;
$args = array_merge( $wp_query->query, array( 'posts_per_page' => 12 ) );
query_posts( $args );
$x = 0;
while (have_posts()) : the_post(); ?>
【问题讨论】: