Skip Navigation

[Resolved] Creating a View Displaying a Taxonomy and The Posts by Date

This support ticket is created 2 years, 9 months ago. 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.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by Nigel 2 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#2282351
Screen Shot 2022-02-02 at 20.44.42.png

The screenshot displays what I'm trying to do. Basically, I want to display which categories had a post on each day of the month. I know it would be very horizontally wide, but that's fine for my needs.

I know how to output the posts within each category using nested views and I have this already done. It's the date as the table/grid heading that is troubling. Is this possible?

Tim

#2282749

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I don't see how you can do this within the UI, you would need to set up a custom PHP template for it, I think.

You want to iterate over dates, but Views queries and iterates over posts (or taxonomy terms, or users), there is no provision for a parent View that queries a month's worth of dates and then iterates over them to then display nested Views of posts published on that date.

You'd have to loop over dates in PHP in a template. You could output a View to display posts from within that template, which would need a query filter for the publish_date, where you passed the date to the View using shortcode attributes, but as you are already working in a PHP template it may be easier to just query the posts directly with get_posts.

#2282813

hmmm, that seems too complicated for me. I assume it would require custom PHP right?

Couldn't I query over posts and use conditionals? So IF Today has a post then display the date in that top header row. I guess that would skip dates with no posts but that could work. Not exactly sure how to do that but I think Views could do it, right?

Or could I enter the dates manually, then use a conditional to check if that date has a post with that date. If so, then display that post.

Tim

#2298853

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Sorry Tim, there was a glitch in our system and this thread has been lost in no-man's land until now.

Yes, that would require custom PHP, and I don't see how you can do this without it.

If each "date" only had one post then you could do something like it, have the View query the posts, ordered by date, and then in the output section using a table format, output the post date as the column header, and the post title from the same post in a separate row. But your columns should contain nested Views outputting all of the posts from that date.

A custom template would be the way to go.