Support » Plugin: Events Manager » Recurring Event – Display custom info from each date

  • Resolved ryanoutloud

    (@ryanoutloud)


    I have recurring events that are book clubs, but each meeting each book club has a different book they read. I have setup custom fields for the book title, author, and link.

    Here is what I currently have: http://munson.liquidweb.com/~bvpb/book-clubs/

    As you can see I only want to display each Book Club once, then show the book info for the next meeting of that club. What’s the best way to go about this?

    Here is what I am currently using.

    $args = array(
    'scope'=>$beginDate.','.$endDate,
    'limit'=>10,
    'pagination'=>1,
    'category'=>12,
    'recurring'=>1,
    'format' => '
    		<article class="club">
    			#_EVENTIMAGE{329,246}
    			<div class="title">
    				<div class="text-left">
    					<br/>
    					<strong class="title"><a href="#_EVENTURL">#_NAME</a></strong><br/>
    					<time datetime="#_{m-j-y}" class="time">#_ATT{sub_title}</time>
    				</div>
    			</div>
    			<div class="detail">
    				 <div class="row">
    					<div class="btns-holder">
    						<a href="#_EVENTICALURL">add to calendar</a>
    					</div>
    					<ul class="social-networks">
    						<li><a href="http://www.facebook.com/sharer.php?u=#_EVENTURL&t=BVPL.org #_NAME" target="_blank">facebook</a></li>
    						<li class="twitter"><a href="http://twitter.com/share?text=BVPL.org #_NAME&url=#_EVENTURL" target="_blank">twitter</a></li>
    					</ul>
    				</div>
    				<div class="text-left">
    					<span class="subtitle"></span>
    					<strong class="title"><a href="#_EVENTURL">#_NAME</a></strong><br/>
    					<time datetime="#_{m-j-y}" class="time">#_ATT{sub_title}</time>
    				</div>
    				<div class="text-holder">
    					<div class="text-right">
    						<p>#_EVENTEXCERPT</p>
    					</div>
    					<div class="text-right">
    						<p><strong>Next Meeting:</strong> #_{M d}</p>
    						<p><strong>Book:</strong> <a href="#_ATT{selected_book_link}">#_ATT{selected_book}</a></p>
    						<p><strong>Author:</strong> #_ATT{author}</p>
    					</div>
    				</div>
    				<a href="#_EVENTURL" class="moreinfo">More Info ></a>
    			</div>
    		</article>
    '
    );
    
    echo em_events($args);

    http://wordpress.org/plugins/events-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • have you tried recurrence=X where X is the event id of the recurring event ?

    Event Search Attributes

    I have not, I was trying to avoid any unnecessary loops, but I think I can make that work if that’s the simplest way.

    Is there a quick call to get an array of all the recurring event IDs?

    Plugin Author Marcus

    (@netweblogic)

    NetWebLogic Support

    EM_Events::get(array('recurring'=>1, 'array'=>1));

    Thanks for the quick reply Marcus. That will work if I can get back the event id instead of the post id.

    Plugin Author Marcus

    (@netweblogic)

    NetWebLogic Support

    $EM_Event = em_get_event($post);
    $EM_Event->event_id;

    or

    $EM_Event = em_get_event($post->ID, 'post_id');
    $EM_Event->event_id;

    🙂

    Got it, thanks fellas.

    $eventPosts = EM_Events::get(array('recurring'=>1, 'array'=>1));
    
    			foreach ($eventPosts as $post){
    				$EM_Event = em_get_event($post['post_id'], 'post_id');
    				$eventID = $EM_Event->event_id;
    
    				$args = array(
    					'scope'=>$beginDate.','.$endDate,
    					'limit'=>1,
    					'category'=>12,
    					'recurrence'=>$eventID,
    					'format' => '
    							<article class="club">
    								#_EVENTIMAGE{329,246}
    								<div class="title">
    									<div class="text-left">
    										<br/>
    										<strong class="title"><a href="#_EVENTURL">#_NAME</a></strong><br/>
    										<time datetime="#_{m-j-y}" class="time">#_ATT{sub_title}</time>
    									</div>
    								</div>
    								<div class="detail">
    									 <div class="row">
    										<div class="btns-holder">
    											<a href="#_EVENTICALURL">add to calendar</a>
    										</div>
    										<ul class="social-networks">
    											<li><a href="http://www.facebook.com/sharer.php?u=#_EVENTURL&t=BVPL.org #_NAME" target="_blank">facebook</a></li>
    											<li class="twitter"><a href="http://twitter.com/share?text=BVPL.org #_NAME&url=#_EVENTURL" target="_blank">twitter</a></li>
    										</ul>
    									</div>
    									<div class="text-left">
    										<span class="subtitle"></span>
    										<strong class="title"><a href="#_EVENTURL">#_NAME</a></strong><br/>
    										<time datetime="#_{m-j-y}" class="time">#_ATT{sub_title}</time>
    									</div>
    									<div class="text-holder">
    										<div class="text-right">
    											<p>#_EVENTEXCERPT</p>
    										</div>
    										<div class="text-right">
    											<p><strong>Next Meeting:</strong> #_{M d}</p>
    											<p><strong>Book:</strong> <a href="#_ATT{selected_book_link}">#_ATT{selected_book}</a></p>
    											<p><strong>Author:</strong> #_ATT{author}</p>
    										</div>
    									</div>
    									<a href="#_EVENTURL" class="moreinfo">More Info ></a>
    								</div>
    							</article>
    					'
    					);
    
    					if (EM_Events::count( $args ) > 0 ) {
    						echo em_events($args);
    					}
    			}
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Recurring Event – Display custom info from each date’ is closed to new replies.