Skip Navigation

[Resolved] How to display conditional output

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display conditional output based on custom date and category or taxonomy term

Solution:
Toolset offers shortcode [wpv-conditional] to display the conditional content.

Please check following Doc - "Checking if a post has a specific term assigned to post":
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific

You can find proposed solution, in this case, with the following reply:
https://toolset.com/forums/topic/i-need-to-show-content-from-more-than-1-content-piece-within-a-custom-post-type/#post-903603

Relevant Documentation:
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/#checking-if-a-date-has-already-passed

This support ticket is created 6 years, 8 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 6 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#903245

I have created a post type called "prévision" (weather forcasts) with all the relevant fields. I've also created a template and layout for that post type.
What I really need to do is to show on 1 page content from multiple pages/articles of the same post type. Among their fields is a date. Each "post" is only relevant to 1 date (using a date field) and relevant to 1 Taxonomy/category (in my case Cities).

So I'd like to build a page which would show a weather forecast for today, + 9 days, where today shows all fields, the next 3 days only some of the fields, and the others much less.

So my question is this, how can I pull field data, conditionally from a specific field date and 1 taxonomy, from various posts into 1 page?

#903603

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - Toolset offers shortcode [wpv-conditional] to display the conditional content.

Please check following Doc - "Checking if a post has a specific term assigned to post":
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/#specific

Here is info how you can check date fields conditionally:
=> https://toolset.com/documentation/user-guides/conditional-html-output-in-views/checking-types-fields-and-custom-fields/#checking-if-a-date-has-already-passed

More info:
=> https://toolset.com/documentation/user-guides/date-filters/