admin管理员组文章数量:1390956
Please help me
I want to make a list based on the name of the day ordered based on the selected category
I have code like this but it doesn't work orderby day
<?php
$args = array( 'posts_per_page' => 100, 'offset'=> 0,
'category' => 338,'order'=> 'asc', 'orderby' => 'day');
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<tr>
<td><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></td>
<td><?php the_time('l'); ?></td>
<td><?php the_time('H:i'); ?> Wib</td>
</tr>
<?php endforeach;
wp_reset_postdata();?>
1 week is equal to 7 days how to make wordpres code sorted by day. ?
Please help me
I want to make a list based on the name of the day ordered based on the selected category
I have code like this but it doesn't work orderby day
<?php
$args = array( 'posts_per_page' => 100, 'offset'=> 0,
'category' => 338,'order'=> 'asc', 'orderby' => 'day');
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<tr>
<td><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></td>
<td><?php the_time('l'); ?></td>
<td><?php the_time('H:i'); ?> Wib</td>
</tr>
<?php endforeach;
wp_reset_postdata();?>
1 week is equal to 7 days how to make wordpres code sorted by day. ?
Share Improve this question edited Apr 9, 2020 at 10:51 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Apr 7, 2020 at 22:17 Heri SuryatnoHeri Suryatno 11 Answer
Reset to default 0There is a better method using date_query property of WP_Query class:
'date_query' => array(
'column' => 'post_date',
'after' => '- 1 days'
)
本文标签: dateHow to display posts categori list by day wordpres
版权声明:本文标题:date - How to display posts categori list by day wordpres 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744583155a2614044.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论