adding event info to venues using tribe_include_view_list array

Home Forums Calendar Products Events Calendar PRO adding event info to venues using tribe_include_view_list array

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1007787
    dpeschio
    Participant

    Hi folks,

    I have added categories to venues and am displaying them on a page using a short code. I have events for the venue displaying but I need to filter that info more specifically. I am using the following code to retrieve the the info:

    	<?php echo tribe_include_view_list( array(
    	'venue' => $venue_id, 
    	'eventDisplay' => 'photo', 
    	'posts_per_page' => apply_filters( 
    		'tribe_events_single_venue_posts_per_page', 3 ) 
    		) )?>

    My problem is three fold:
    1 – there is way more info than I want returned by this code. All I want is the date displayed like it is on the widget, the featured image and the name of the event. Can give me some guidance on how I would filter that down? I do not want link to previous and next events.

    2- events are displayed as list layout, not in photo grid

    3- the code also returns “Upcoming Events: There were no results found” then display the events. Need to get rid of that.

    Here’s a link to VERY beta version of the page: http://ashevillealetrail.com/brewery-venues-listing

    and the full code Im using:

    <ul class="venue_brewery">
    
    <?php $categories = get_categories( $args ); ?>
      <?php
    			$my_query =  new WP_Query( array( 'post_type' => 'tribe_venue', 
    					'tax_query' => array(
            array(
                'taxonomy' => 'tribe_venue_category',
                'field' => 'slug',
                'terms' => 'brewery-full'
            		)
        		),
    			 'orderby' => 'rand', 'order' => 'ASC', 'posts_per_page' => -1 ) );
    
    					if( $my_query->have_posts() ) {
    					  while ($my_query->have_posts()) : $my_query->the_post();
    					  $thumburl = wp_get_attachment_url( get_post_thumbnail_id ($my_query->ID) );
    					  $venue_id = get_the_ID();
    					  ?>
                          
    				  <?php $user_count = $wpdb->get_var( "SELECT count(*) FROM <code>xjs_postmeta</code> WHERE meta_value='".get_the_ID()."'" ); ?>
                      
                      <li class="li_venue">
                      <!--venue Title--> 
                        <h2 class="venue_brewery_full_title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
                      <!--End venue Title--> 
                      
                        
    <!--venue thumbnail--> 
                             
                              <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img class="img_venue_full"  src="<?php echo $thumburl; ?>" /></a>
                               
     <!--End venue thumbnail-->                           
     <!--adds venu meta-->
                        <div class="tribe-events-meta-group tribe-events-meta-group-venue">
                            
                            <dl>
                                <?php do_action( 'tribe_events_single_meta_venue_section_start' )?>
                        
                                <dd class="author fn org"> <?php echo tribe_get_venue() ?> </dd>
                        
                                <?php
                                // Do we have an address?
                                $address = tribe_address_exists() ? '<address class="tribe-events-address">' . tribe_get_full_address() . '</address>' : '';
                        
                                // Do we have a Google Map link to display?
                                $gmap_link = tribe_show_google_map_link() ? tribe_get_map_link_html() : '';
                                $gmap_link = apply_filters( 'tribe_event_meta_venue_address_gmap', $gmap_link );
                        
                                // Display if appropriate
                                if ( ! empty( $address ) ) {
                                    echo '<dd class="location">' . "$address $gmap_link </dd>";
                                }
                                ?>
                        
                                <?php if ( ! empty( $phone ) ): ?>
                                    <dt> <?php _e( 'Phone:', 'tribe-events-calendar' ) ?> </dt>
                                    <dd class="tel"> <?php echo $phone ?> </dd>
                                <?php endif ?>
                        
                                <?php if ( ! empty( $website ) ): ?>
                                    <dt> <?php _e( 'Website:', 'tribe-events-calendar' ) ?> </dt>
                                    <dd class="url"> <?php echo $website ?> </dd>
                                <?php endif ?>
                        
                                <?php do_action( 'tribe_events_single_meta_venue_section_end' ) ?>
                            </dl>
                        </div>
    	<!--end venu meta-->
        
         <div style="clear:both;"></div>
                                          
                         <!-- Adds upcoming events -->
    	<?php // Use the 'tribe_events_single_venue_posts_per_page' to filter the 
    	 	  // number of events to display beneath the venue info on the venue page.
    	?> 
    	<?php echo tribe_include_view_list( array(
    	'venue' => $venue_id, 
    	'eventDisplay' => 'photo', 
    	'posts_per_page' => apply_filters( 
    		'tribe_events_single_venue_posts_per_page', 3 ) 
    		) )?>
            
    	<?php /*do_action('tribe_events_single_venue_after_upcoming_events') */?>
                           <!--end upcoming events -->
                           
                             
                        
    
                        
                        <div class="clear" style="clear:both;"></div>
                      </li>
      
      <?php  endwhile;
    					}
    					wp_reset_query();  // Restore global post data stomped by the_post().
    					?>
    </ul>
    

    Thanks in advance for your help.

    Cheers!

    #1008027
    George
    Participant

    Hey @dpeschio,

    I’m sorry to bear this news, but we unfortunately do not offer any support for custom code-writing and so I will have to close up this thread 🙁

    If you need help with customizations, you can hire a developer – we have some well-rated developers listed here if you’re interested: https://theeventscalendar.com/find-a-customizer

    Best of luck with your customizations!

    Sincerely,
    George

    #1008459
    dpeschio
    Participant

    Seriously? This is the help you offer…”hire a developer”? I’m pissed about this.

    First, I love your plug in.

    Second – We have the pro version with a number of extensions, and in my opinion what I’m building should be available at the pro level. I need a page that shows venues, sorts them by category and shows a few events for the venue – so I’m building it. I had to add the ability categories to venues – and yes I have asked for that function as a feature in future releases. Then I had to make a shortcode to display the venues by categories – done.

    Now all I’m asking is for some documentation on the arguments I can use with tribe_include_view_list so I can filter and style the content. Just point me in the right direction and I’ll figure it out.

    “Hire a developer” It’s like you gave me a pat on the head and told me to run along. I AM going to figure this out. Unfortunately you’ve added a few hours to my efforts. That sucks for me, but I’ll get it and know more when I’m done.

    Thanks for nuthin.

    #1008753
    George
    Participant

    Hey @dpeschio,

    I’m sorry to hear that you’re pissed about this, making you feel that way was far from my intention and I did not realize that your question was so simple.

    In your second reply, you said your question was this:

    all I’m asking is for some documentation on the arguments I can use with tribe_include_view_list so I can filter and style the content

    But in your first reply, I read your questions as this:

    My problem is three fold:
    1 – there is way more info than I want returned by this code. All I want is the date displayed like it is on the widget, the featured image and the name of the event. Can give me some guidance on how I would filter that down? I do not want link to previous and next events.

    2- events are displayed as list layout, not in photo grid

    3- the code also returns “Upcoming Events: There were no results found” then display the events. Need to get rid of that.

    I read this as two separate CSS-style questions (1 and 3), and then a question about how to make a duplicate version of the photo grid (2). All three things combined are some substantial customizations, or at least enough to be beyond the scope of customization support we can provide.

    I’m sorry about the misunderstanding, @dpeschio, and it honestly was just a misunderstanding – I had the impression you were asking for far more than some help with the documentation about one function.

    Speaking of which, let’s turn to that function: tribe_include_view_list()

    If you’re curious about all the available function arguments for this function, basically there is one parameter called $args, an array. This is what you’re already using in the code snippet in your first post in this thread.

    This $args array itself gets passed to the method Tribe__Events__Query::getEvents(), which is also the method that is called by the function tribe_get_events().

    So, even though it seems a bit odd, you can actually learn all of the arguments for tribe_include_view_list() by learning the arguments for tribe_get_events() and for WordPress’ built-in class WP_Query.

    You can learn more about tribe_get_events() here:

    And you can learn more about WP_Query here:

    I hope this all helps – let me know!

    Sincerely,
    George

    #1013430
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘adding event info to venues using tribe_include_view_list array’ is closed to new replies.