如何只在wordpress一次显示重复事件

时间:2015-06-16 05:50:04

标签: php wordpress events recurring

很抱歉,如果这是基本的,因为我在这里找不到任何可能的帮助...所以如果有人可以帮助解决有关wordpress的这两个问题,那将会很棒。

1)如何设置每周三发生的重复事件,以便只显示一次而不是每个实例?

2)并且显示的日期可以说“星期三”而不是事件的日期(仅在重复事件的情况下)

因为我在本地运行,所以我无法共享网址... but heres a screen grab,我也会尝试粘贴下面的代码。

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 个答案:

没有答案