ACF Plugin | abgelaufene Events löschen
-
Hi,
habe da nen Hänger mit ner Funktion um vergangene Events zu löschen oder besser vielleicht die dann in Draft verschieben.
Danke
<ul class="event-dates"> <?php $args = array( 'posts_per_page' => -1, 'post_type' => 'event', 'meta_key' => 'datebegin', 'orderby' => 'meta_value_num', 'order' => 'ASC' ); $the_query = new WP_Query( $args ); ?> <?php $floatwork_month == NULL; ?> <?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> <?php if ( $floatwork_month != date('M', strtotime(get_field('datebegin')))) : ?> <?php $floatwork_month = date('M', strtotime(get_field('datebegin'))) ?> <div class="monat"> <h2><?php echo $floatwork_month; ?></h2> <h3><?php the_time('Y'); ?></h3> </div> <?php endif; ?> <?php if (get_field('datebegin') != get_field('dateend') && get_field('dateend') != NULL ) : ?> <div class="doublebox"> <li> <?php the_post_thumbnail( array( ) ); ?> <div class="text-box-big"><h2><?php $string = get_field('datebegin'); $timestamp = strtotime($string); echo date("d", $timestamp); ?> - <?php $string = get_field('dateend' ); $timestamp = strtotime($string); echo date("d", $timestamp); ?></h2> <h4><?php the_title(); ?></h4> <p><?php the_field('eventinfos'); ?></p> </div><!-- end text box big --> </li> <?php else : ?> <div class="box"> <li> <?php the_post_thumbnail( array( ) ); ?> <div class="text-box"><h2><?php $string = get_field('datebegin' ); $timestamp = strtotime($string); echo date("d", $timestamp); ?></h2> <h4><?php the_title(); ?></h4> <p><?php the_field('eventinfos'); ?></p> </div><!-- end text box --> </li> <?php endif; ?> </div><!-- end box --> <?php endwhile; wp_reset_postdata(); ?> <div class="last-box"> <h4>Weitere Events folgen</h4> </div><!-- end last box --> <div class="clear"></div> <!-- end beitrag -->
Moderationshinweis: Bitte Code immer auch als Code auszeichnen! Danke.
Ansicht von 3 Antworten – 1 bis 3 (von insgesamt 3)
Ansicht von 3 Antworten – 1 bis 3 (von insgesamt 3)
- Das Thema „ACF Plugin | abgelaufene Events löschen“ ist für neue Antworten geschlossen.