Posts that feed in events of current posts author

Home Forums Calendar Products Events Calendar PRO Posts that feed in events of current posts author

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #950337
    Craig
    Participant

    I am currently making a site that will have coach pages. Each coach will have one page which is a custom post type and they will have their own login. Each coach will be able to create events using the ECP Community Events add on.

    Currently on my coach-single.php template I am pulling in upcoming events. My goal is to only feed in events that relate to that current posts author. Hope that makes sense. This is the current code I am using.

    <?php
    
    global $post;
    $all_events = tribe_get_events(
    	array(										
    		'eventDisplay'=>'upcoming',
    		'posts_per_page'=>5,																			
    )
    );
    
    foreach($all_events as $post) {
    setup_postdata($post);
    ?>
    							
    <ul>	
    	<li class="date"><?php echo tribe_get_start_date( $post->ID, false, 'M' ); ?><br/><span><?php echo tribe_get_start_date( $post->ID, false, 'j' ); ?></span></li>
    	<li class="title"><a href="<?php echo tribe_get_event_link(); ?>" rel="bookmark"><?php the_title(); ?></a></li>		
    	<li class="time"><?php echo tribe_get_start_date( $post->ID, false, 'g:i a' ); ?></li>						
    </ul>
    
    <?php } //endforeach ?>
    <?php wp_reset_query(); ?>
    

    I really have not done much else to this site but you can see and example of one of the pages at http://coaches.21daysugardetox.com/coaches/craig-moser/

    #950479
    Brian
    Member

    Hello,

    I can help point you in the right direction here.

    tribe_get_events uses the same query arguments as wp_query:

    https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters

    If each coach has their own WordPress account you can use the author parameters to get just their events.

    Does that help?

    Thanks

    #964980
    Brian
    Member

    Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Posts that feed in events of current posts author’ is closed to new replies.