How do you display recurring events only once wordpress

171 views Asked by At

Sorry if this is elementary as i'm figuring these out myself with no possible help around here... so it would be great if anyone could help with these 2 questions regarding wordpress.

1) how to set a recurring event that happens every wednesday such that it will only be displayed once instead of every instance?

2) and can the date shown to say “Wednesdays” instead of the date of the event (only in the case of recurring events)

Because I'm running this locally so I can't share the url... but heres a screen grab, and I'll try to paste the code below as well.

if ( ! defined( 'ABSPATH' ) ) { exit; } $prefix = Haze_Meta_Boxes::get_instance()->prefix; $Event = clx_get_event_meta(get_the_ID()); ?>

<div class="col-sm-4">
  <div class="container-row">
    <div class="row">
      <div class="col-sm-12">
        <div class="widget single-event-widget">
          <figure class="clearfix">
            <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
            <figcaption>
              <a href="<?= wp_get_attachment_url( get_post_thumbnail_id( get_the_ID() ) ); ?>" rel="prettyPhoto[gallery]">
                <?php the_post_thumbnail( 'song_single'); ?>
              </a>
            </figcaption>
            <?php endif; ?>
            <div class="date">
              <?php // TODO Here, take the date format from the user. ?>
              <?php echo date( 'd / M / Y', strtotime($Event[ 'event_start_date'])); ?>
            </div>
          </figure>
        </div>
      </div>
    </div>
  </div>
  <div class="container-row">
    <div class="row">
      <div class="col-sm-12">
        <div class="widget event-widget-countdown">
          <figure class="clearfix">
            <section>
              <?php // Construct the date into an accepted Date object of jQuery // Send the date with the dateTo attribute // Take it in jQuery and construct the countdown $timestamp=s trtotime($Event[ 'event_start_date'] . ' ' . $Event[ 'event_start_hour']. ':'.$Event[
              'event_start_minute'] . ' '. $Event[ 'event_start_am_pm'] ); $dateTo=d ate( 'Y,m,', $timestamp); $dateTo .=( date( 'j', $timestamp) - 1); $dateTo .=d ate( ',h,i,s', $timestamp); ?>
              <ul class="timer clearfix" data-year="<?= date('Y', $timestamp); ?>" data-month="<?= (date('m', $timestamp) - 1); ?>" data-day="<?= date('j', $timestamp); ?>" data-hour="<?= date('H', $timestamp); ?>" data-minute="<?= date('i', $timestamp); ?>" data-days-t="<?php _e('days', LANGUAGE_ZONE); ?>"
              data-hours-t="<?php _e('hours', LANGUAGE_ZONE); ?>" data-minutes-t="<?php _e('minutes', LANGUAGE_ZONE); ?>" data-seconds-t="<?php _e('seconds', LANGUAGE_ZONE); ?>">
              </ul>
            </section>
          </figure>
        </div>
      </div>
    </div>
  </div>
</div>
<div class="col-sm-8">
  <div class="container-row">
    <div class="row">
      <div class="col-sm-12">
        <article class="post-article single-post clearfix">
          <div class="content-article clearfix">
            <h1>
                    <a href="<?php the_permalink(); ?>">
                        <?php the_title(); ?>
                    </a>
                </h1>
            <?=c lx_get_google_maps($Event[ 'event_address'], $Event[ 'event_show_map']); ?>
              <hr>
              <div class="event-details">

                <?php clx_buy_tickets_button(get_the_ID()); ?>

                <div class="details">

                  <?php if($Event[ 'event_venue_name']): ?>
                  <p>
                    <span>
                                    <strong><?php _e('Venue:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_venue_name']; ?>
                  </p>
                  <?php endif; ?>

                  <?php if($Event[ 'event_city'] && $Event[ 'event_country']): ?>
                  <p>
                    <span>
                                    <strong><?php _e('Location:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_city'] . ', ' . $Event[ 'event_country']; ?>
                  </p>
                  <?php elseif($Event[ 'event_city']) : ?>
                  <p>
                    <span>
                                    <strong><?php _e('Location:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_city']; ?>
                  </p>
                  <?php elseif($Event[ 'event_country']) : ?>
                  <p>
                    <span>
                                    <strong><?php _e('Location:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_country']; ?>
                  </p>
                  <?php endif; ?>

                  <p>
                    <span>
                                <strong><?php _e('Date:', LANGUAGE_ZONE); ?></strong>
                            </span>
                    <?php // TODO Here, take the date format from the user. ?>
                    <?=d ate( 'M d', strtotime($Event[ 'event_start_date'])) . ' '. __( 'to', LANGUAGE_ZONE) . ' ' . date( 'M d', strtotime($Event[ 'event_end_date'])); ?>
                  </p>

                  <?php if( $Event[ 'event_all_day'] ): ?>
                  <p>
                    <span>
                                    <strong><?php _e('Length:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?php _e( 'All day.', LANGUAGE_ZONE); ?>
                  </p>
                  <?php else : ?>
                  <p>
                    <span>
                                    <strong><?php _e('Length:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_start_hour']; ?>:
                      <?=$ Event[ 'event_start_minute']; ?>
                        <?=$ Event[ 'event_start_am_pm']; ?>-
                          <?=$ Event[ 'event_end_hour']; ?>:
                            <?=$ Event[ 'event_end_minute']; ?>
                              <?=$ Event[ 'event_end_am_pm']; ?>
                  </p>
                  <?php endif; ?>

                  <?php if($Event[ 'event_price'] && $Event[ 'event_enable_tickets']): ?>
                  <p>
                    <span>
                                    <strong><?php _e('Ticket Price:', LANGUAGE_ZONE); ?></strong>
                                </span>
                    <?=$ Event[ 'event_price_currency'] . $Event[ 'event_price']; ?>
                  </p>
                  <?php endif; ?>

                </div>
              </div>
              <hr>
              <div class="entry-content">
                <?php the_content(); ?>
              </div>

          </div>
        </article>
      </div>
    </div>
    <div class="row">
      <div class="col-sm-12">
        <!-- ============== COMMENTS CONTAINER ============= -->
        <div class="comment-container">
          <div class="col-sm-12">

            <?php comments_template( '', true); ?>

          </div>
        </div>
      </div>
    </div>
  </div>
</div>

0

There are 0 answers