I am trying to put a header before past posts and after future posts.
I’m using get_posts()
in a function to output the posts using a foreach
loop for a custom post type ordered by date (meta key). If a post’s associated date is less than the current date (i.e., dates not in the future), I want to output some HTML.
if ($custom_post_date >= $today && $index === 1)
The problem I am running into is that the HTML gets output after the first post that is in the past. How can I output the HTML before the first post that meets the criteria? Is there a way to go back in the foreach
loop or something to that effect?
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com