因此,我正在运行以下查询:
<?php
$args = new WP_Query(array(
\'post_type\' => \'attachment\',
\'posts_per_page\' => -1,
\'oderby\' => \'title\',
\'order\' => \'ASC\',
\'post_status\' => \'any\',
\'post_parent\' => null,
\'tax_query\' => array(
array(
\'taxonomy\' => \'post_tag\',
\'field\' => \'slug\',
\'terms\' => \'logo\'
)
)
));
while ( $args->have_posts() ) : $args->the_post();
?>
我需要解决的一个问题是为附件提供更好的排序方法。目前,我只能通过标题ASC或DESC获得它。我知道WP\\u查询中还有其他可用的orderby属性,但并非所有属性都有效。我想知道是否有人知道如何修改媒体库中图像的上传日期,因为这样我就可以修改我的查询,使其基于过期,我们可以编辑图像的日期,以便首先显示较新的图像等。任何可以帮助我更多地手动控制这一点的想法都会很好。谢谢