我有一个查询,其中显示了捐赠者的姓名以及献礼。它使用日期元查询显示。
$args = array(
\'post_type\' => \'donors\',
\'order_by\' => \'id\',
\'order\' => \'DESC\',
\'posts_per_page\' => -1,
\'date_query\' => array(
array(
\'after\' => $from,
\'before\' => $to
),
\'inclusive\' => true,
),
\'meta_query\' => array(
array(
\'key\' => \'type\',
\'value\' => \'donor\',
\'compare\' => \'=\'
)
)
);
我想让它以一种不受限制的方式显示,但出于某种原因,它只显示252个项目,而应该显示378个项目。我能做多少查询有没有限制?EDIT
这是我自定义查询的完整代码$colors = array(\'#00274E\', \'#a33038\', \'#6391B5\');
$separators = array();
$sepcount = 0;
$sepindex = 0;
$args = array(
\'post_type\' => \'arcf_donors\',
\'order_by\' => \'id\',
\'order\' => \'DESC\',
\'posts_per_page\' => -1,
\'is_paged\' => true,
\'paged\' => $paged,
\'meta_query\' => array(
array(
\'key\' => \'type\',
\'value\' => \'donor\',
\'compare\' => \'=\'
)
)
);
$subquery = new WP_Query($args);
$separators = array(
\'http://.s3.amazonaws.com/wp-content/uploads/445_4387134.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/564_3765091.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/829_4027101.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/988_4172711.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/987_4120232.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/127_3764954.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/440_4241356resized.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/127_3764954.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/311_2996427.jpg\',
\'http://.s3.amazonaws.com/wp-content/uploads/445_4387134.jpg\'
);
<?php if ( $subquery->have_posts() ):
while ( $subquery->have_posts() ): $subquery->the_post();
$color = $colors[mt_rand(0,2)]; $sepcount++; ?>
<?php if ($sepcount == 5): ?>
<?php $sepindex++; ?>
<?php if ($sepindex > 9) $sepindex = 0;?>
<div id="post-290" class="<?php print $sepindex; ?> post-size-1x1 project type-project status-publish format-link hentry post-single has_thumb about about experiments experiments portfolio portfolio services services team team post" data-post-size="1x1">
<div class="inner-image-placeholder" id="post-290-in" style="background-image: url(\'<?php echo $separators[$sepindex]; ?>\');">
<div class="image-link-inner"></div>
</div>
</div>
<?php $sepcount = 0; ?>
<?php else: ?>
<div id="post" class=" post-size-<?php the_field(\'brick_size\'); ?> project type-project status-publish format-standard hentry has_thumb portfolio portfolio post" data-post-size="<?php the_field(\'brick_size\'); ?>" style="background-color:<?php echo $color; ?>">
<div class="post-wrapper inner-image-placeholder">
<!-- Begin Title Section -->
<div class="image-link-inner">
<?php
echo \'<p class="donor">\';
echo the_title();
echo \'</p>\';
if ($show == \'dedication\'):
if (get_field(\'brick_message\') != \'\' || get_field(\'block_message\') != \'\'):
echo \'<div class="image-post-overlay" style="display: block;"><div class="image-post-overlay-in">\';
if (get_field(\'brick_size\') == \'1x1\'):
echo \'<p>\'. the_field(\'brick_message\') .\'</p>\';
else:
echo \'<p>\'. the_field(\'block_message\') .\'</p>\';
endif;
echo \'</div></div>\';
endif;
endif;
?>
</div>
<!-- Begin Dedication Section -->
<?php if (get_field(\'brick_message\') != \'\' || get_field(\'block_message\') != \'\'): ?>
<div class="image-post-overlay">
<div class="image-post-overlay-in">
<?php
if ($show == \'name\'):
if (get_field(\'brick_size\') == \'1x1\'):
echo \'<p>\'. the_field(\'brick_message\') .\'</p>\';
else:
echo \'<p>\'. the_field(\'block_message\') .\'</p>\';
endif;
else:
echo the_title();
endif;
?>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>