Events by post count

Home Forums Calendar Products Events Calendar PRO Events by post count

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #325933
    helloodds
    Participant

    Hi all – I’m hoping someone might be able to help me out with a pickle I’m having. I’m using the events list widget and have customized the output to include several css styles. I would like to change these styles based on the event count. So if only one event, then use this specific style, if 3 events use this other style. Kind of like post count in the normal wp loop (<?php if ($count == 1) : ?>). Can anyone point me in the correct language to use with the events list to make this happen? Essentially, I just want the with of my columns to change depending on how many events are listed. Thanks in advance for your help.

      <?php
      foreach( $posts as $post ) :
      setup_postdata( $post );
      ?>
      <li class=”<?php tribe_events_event_classes() ?> medium-4 columns event” data-equalizer-watch>
      ….. stuff ….

    #326355
    helloodds
    Participant

    Oh, silly me, I figured it out! If anyone else is ever looking…
    <?php if (count($posts) == 2) : ?>my_style<?php endif; ?>

    #983397
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Events by post count’ is closed to new replies.