Victor

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Community Event Form appears in Footer #916291
    Victor
    Participant

    Hi, Brian,
    You are right, switching to a classic theme solves the issue. I managed, however to solve this by adding a sort of hack to the edit-event.php file:

    <?php do_action( 'tribe_events_community_form_after_template' ); ?>
    </div></div></div></div></div></div>
    <?php get_footer(); ?>
    

    Basically I close all the divs that hold the form and force a footer. I know it’s not elegant, but for now it solves the problem.

    Thanks for your help.

    in reply to: Community Event custom query #890283
    Victor
    Participant

    Thanks Brian, that did the trick.
    For all of you who want to display community events on a particular page here is a shortcode for that (add to functions.php):

    add_shortcode('community_gatherings', 'community_gatherings_shortcode_query');
    function community_gatherings_shortcode_query($atts){
    	global $post;
    
    	$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    
    	$upcoming = new WP_Query();
    	$upcoming->query(
    		array(
    		'post_type'=> 'tribe_events',
    		'eventDisplay' => 'upcoming',
    		'posts_per_page' => 3,
    		'paged' => $paged,
    		'meta_query' => array(
    				array(
    					'key'     => '_EventOrigin',
    					'value'   => array('community-events'),
    					'compare' => 'IN',
    				),
    			),
    		)
    	);
    
    	$output = '';
    	$output .= '<h3 class="upcoming-list-title"><span>Latest On The Road Gatherings with Craig Johnson</span></h3>';
    	$output .= '<div class="row">';
    	if ($upcoming->have_posts()) :
    		while ($upcoming->have_posts()) :
    			$upcoming->the_post();
    			$output .= '<div class="col-lg-4">';
    			$output .= '<div class="gathering">';
    			if ( has_post_thumbnail() ) {
    				$output .= '<div class="gathering-image">'.get_the_post_thumbnail().'</div>';
    			}
    			$output .= '<h2 class="gathering-title">'.get_the_title().'</h2>';
    			$output .= '<div class="gathering-meta"><span class="gathering-date">';
    			if (tribe_event_is_all_day()){
    				$output .= tribe_get_start_date($post->ID).' - all day';
    			} else {
    				$output .= tribe_get_start_date($post->ID);
    				$output .= ' - ';
    				if (tribe_get_start_date($post->ID) !== tribe_get_end_date($post->ID) ){
    					$output .= tribe_get_end_date($post->ID);					
    				} else {
    					$output .= tribe_get_end_time($post->ID);					
    				}
    			}		
    			$output .= '</span></div>';
    			$output .= '<div class="gathering-excerpt">'.get_the_excerpt().'</div>';
    			$output .= 'Join this Gathering <i class="fa fa-chevron-right"></i>';
    			$output .= '</div></div>';
    		endwhile;
    		$output .= '<div class="col-lg-12"><div class="gathering-nav">'.etheme_pagination($upcoming, $paged).'</div></div>';
    	endif;
    	$output .= '</div>';
    
    	wp_reset_query();
    
    	return html_entity_decode($output);
    }
    

    Then in your page editor add:
    [community_gatherings]
    My client wanted to replace events with gatherings, thus the term.
    Hope it helps.

Viewing 2 posts - 1 through 2 (of 2 total)