Kari Acker

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • in reply to: Pull in latest featured event. #1317088
    Kari Acker
    Participant

    Thanks for looking into this for me. Here is the code i ended up with and with this code nothing get pulled in at all. Do you think this is something wrong with how I integrated your code in with mine?

    
    		<div class="small-12 medium-6 large-4 columns">
    			<?php $args = array(
    			'eventDisplay'   => 'custom',
    			'posts_per_page' => 1,
    			'meta_query'     => array(
    				'relation'   => 'AND',
    				'featured'   => array(
    					'key'     => Tribe__Events__Featured_Events::FEATURED_EVENT_KEY,
    					'compare' => 'EXISTS',
    				),
    				'start_date' => array(
    					'key'     => '_EventStartDate',
    					'value'   => current_time( 'mysql' ),
    					'compare' => '>=',
    					'type'    => 'DATETIME',
    				),
    			),
    			'orderby'        => array(
    				'start_date' => 'ASC',
    			),
    		);
    				foreach ( $events as $event ) {
    					$terms = get_the_terms( $event->ID, 'tribe_events_cat' ); ?>
    						<p class="home-cat"><?php foreach ( $terms as $term ) { echo $term->name; } ?></p>
    						<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<?php echo tribe_event_featured_image( $event->ID, 'home-blog', true ); ?>
    						</a>
    						<div class="home-news-content clearfix" data-equalizer-watch>
    							<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<h2><?php echo $event->post_title; ?></h2></a>
    							<p><?php echo $event->post_excerpt; ?></p>
    							<a class="home-read-more" href="<?php echo tribe_get_event_link( $event->ID ) ?>">Read More</a>
    						</div>
    			<?php } ?>
    		</div>
    
    in reply to: Pull in latest featured event. #1312082
    Kari Acker
    Participant

    Hi,

    Im looking for the next upcoming featured event (based on start date).

    Thanks
    -Dan

    in reply to: Pull in latest featured event. #1309210
    Kari Acker
    Participant

    Hi, So this is what i ended up with and its still just pulling in the latest event.

    
    		<div class="small-12 medium-6 large-4 columns">
    			<?php $events = tribe_get_events( array( 'posts_per_page' => 1, 'orderby' => 'meta_value', 'order' => 'DESC' , 'key' => Tribe__Events__Featured_Events::FEATURED_EVENT_KEY , 'compare' => 'EXISTS' ) );
    				foreach ( $events as $event ) {
    					$terms = get_the_terms( $event->ID, 'tribe_events_cat' ); ?>
    						<p class="home-cat"><?php foreach ( $terms as $term ) { echo $term->name; } ?></p>
    						<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<?php echo tribe_event_featured_image( $event->ID, 'home-blog', true ); ?>
    						</a>
    						<div class="home-news-content clearfix" data-equalizer-watch>
    							<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<h2><?php echo $event->post_title; ?></h2></a>
    							<p><?php echo $event->post_excerpt; ?></p>
    							<a class="home-read-more" href="<?php echo tribe_get_event_link( $event->ID ) ?>">Read More</a>
    						</div>
    			<?php } ?>
    		</div>
    in reply to: Pull in latest featured event. #1302250
    Kari Acker
    Participant

    Hi,

    Im sorry but im still having issues getting this to work. Here is my code.

    
    		<div class="small-12 medium-6 large-4 columns">
    			<?php $events = tribe_get_events( array( 'posts_per_page' => 1, 'orderby' => 'meta_value', 'order' => 'DESC' , 'key' => 'Tribe__Events__Featured_Events::FEATURED_EVENT_KEY' , 'compare' => 'EXISTS', ) );
    				foreach ( $events as $event ) {
    					$terms = get_the_terms( $event->ID, 'tribe_events_cat' ); ?>
    						<p class="home-cat"><?php foreach ( $terms as $term ) { echo $term->name; } ?></p>
    						<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<?php echo tribe_event_featured_image( $event->ID, 'home-blog', true ); ?>
    						</a>
    						<div class="home-news-content clearfix" data-equalizer-watch>
    							<a href="<?php echo tribe_get_event_link( $event->ID ) ?>">
    							<h2><?php echo $event->post_title; ?></h2></a>
    							<p><?php echo $event->post_excerpt; ?></p>
    							<a class="home-read-more" href="<?php echo tribe_get_event_link( $event->ID ) ?>">Read More</a>
    						</div>
    					<?php wp_reset_postdata();
    				} ?>
    		</div>

    Please let me know what I can do to get this working.

    Thanks
    -Dan

    in reply to: Pull in latest featured event. #1301355
    Kari Acker
    Participant

    Hi,

    So your highlighted part is talking about just the featured image. I already have that pulling in. Im just trying to get the “featured event” to pull in.

    Thanks
    -Dan

    in reply to: Pull in latest featured event. #1301268
    Kari Acker
    Participant

    Im still a little confused. I have the image pulling in already. Would I have to use this part in my query?`

    `

    // is a Featured Event (requires The Events Calendar version 4.4+ from January 9, 2017)
    if ( class_exists( ‘Tribe__Events__Main’ )
    && class_exists( ‘Tribe__Events__Featured_Events’ )
    && Tribe__Events__Main::POSTTYPE === $query[‘post_type’]
    ) {
    $meta_query[] = array(
    ‘key’ => Tribe__Events__Featured_Events::FEATURED_EVENT_KEY,
    ‘compare’ => ‘EXISTS’,
    );
    }
    `

    in reply to: Pull in latest featured event. #1299080
    Kari Acker
    Participant

    Hi,

    So im still a little confused. Im still somewhat new with PHP and that seems like a really complex query just to pull in the featured event.

    There is no way just to add it to my $events array to pull it in? I would rather not pull this in with a shortcode from my function. I would just like to have everything right in my original query.

    in reply to: Trying to pull in the Events Calendar Pro Cat Name #1287602
    Kari Acker
    Participant

    This worked perfect,

    Thanks for the help.

    in reply to: Linking my custom queries to the events page #1230861
    Kari Acker
    Participant

    This is exactly what I was looking for.

    Thank You.

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