Hi,
I use views in combination with Elementor.
I have a posttype Events with a start date, but some don't have a start date (because they are always available, as videolink)
I have created a view to show upcoming events and display it with a shortcode on the homepage. What code do I add to display only upcoming events (and the posts without date)??
Code:
{% set args = { post_type: "event", posts_per_page: 6, tax_query: [ { taxonomy: 'event-type', field: 'slug', terms: 'yoga-events-live' } ] } %}
{% set posts = mb.get_posts( args ) %}
{% for post in posts %}
<div class="event_card-row">
<div class="event_card-date">
{% if post.event_with_datum == 'No' %}
View every moment
{%else%}
{{ post.event_startdatum | date( 'd F Y' ) }}
{% endif %}
</div>
<div class="event_card-row-title-wrapper">
<h4 class="event_card-row-title">
{{ post.post_title }}
</h4>
</div>
</div