Skip Navigation

[Gelöst] Post Date filter display wrong

This support ticket is created vor 7 Jahre, 4 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Beda vor 7 Jahre, 4 Monate.

Assisted by: Beda.

Author
Artikel
#474615
views2.jpg
views.jpg

I am trying to: create views (in 2016) with " not show today post" so in post date filter

I selected published date = after
and selected Day = CURRENT_ONE
it's work fine until new years 2017 it's not display January 's post (it's show only december 2016)
so I add more condition in filter years = 2016 (published date= after)

it's work but today's post it's appears (I want to skip today post)
here's my site : hidden link

(sorry for my english.)

#474926

Displaying Posts that are published AFTER Today, means displaying posts that are not yet published (instead, they are scheduled)

Are you sure you want to do this?

The posts will not be published, so they will not be displayed.

Can you elaborate on the Goal?
Do you want to display a list of Posts in 2016, that are in a certain time frame?

#475607

Sorry I misunderstood.
Actually I need this views to display older post

I mean I have two section of views
section A: this section show post of today (if thats day has no post this section will disapear)

section B: this section will show older post of section A ( last day post of section A:) and not to show post of today.

in last year i've try to set section B: to after current one it's work fine but for now it's not work anymore maybe I have do wrong direction to make this can you advise me how to do this?

#475657

You can display the Posts of TODAY only by using this Query Filter:

Select posts whose
Published date is equal to: day:CURRENT_ONE()

If you want to display posts of TODAY and any day BEFORE today on the SAME View, you need NO Query Filter, but an HTML conditional.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/

You can use Date filters in there:
https://toolset.com/documentation/user-guides/date-filters/

As example, this below in the View Loop, will display two headings (Today and Last Year) and below it the posts according to Date:

[wpv-conditional if="( '[wpv-post-date format='U']' gt 'PAST_DAY(1)' ) AND ( '[wpv-post-date format='U']' lt 'FUTURE_DAY(1)' )" ]
            Today:
            [wpv-post-link]
[/wpv-conditional]

[wpv-conditional if="( '[wpv-post-date format='U']' lte 'PAST_YEAR(1)' )" ]
            Last Year:
            [wpv-post-link]
[/wpv-conditional] 

Notice that I use the "U" Date Format, wich returns a Timestamp Numeric Value so I can compare correctly to the Date Values (constants)

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.