Making my own Venue list page – how to display venue data

Home Forums Calendar Products Events Calendar PRO Making my own Venue list page – how to display venue data

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #759961
    James Thomson
    Participant

    Hello, I have this page:
    http://multifloraproductions.com/our-venues/

    which is a page that loads the wordpress loop to load in venues added in via the TRIBE plugin.

    Here is what I have, copied from single-venue in the plugin to my our-venues page

    <h3>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h3>
    <div class=”tribe-events-event-meta”>

    <?php if ( tribe_show_google_map_link() ) : ?>
    <!– Google Map Link –>
    <?php echo tribe_get_meta(‘tribe_event_venue_gmap_link’); ?>
    <?php endif; ?>

    <!– Venue Meta –>
    <?php do_action(‘tribe_events_single_venue_before_the_meta’) ?>
    <?php echo tribe_get_meta_group( ‘tribe_event_venue’ ) ?>
    <?php do_action(‘tribe_events_single_venue_after_the_meta’) ?>

    </div><!– .tribe-events-event-meta –>

    <!– Venue Description –>
    <?php if( get_the_content() ) : ?>
    <div class=”tribe-venue-description tribe-events-content entry-content”>
    <?php the_content(); ?>
    </div>
    <?php endif; ?>

    #759963
    James Thomson
    Participant

    The google map and venue meta don’t show, but the title and image and content (if there is any entered) do

    #761830
    Brook
    Participant

    Howdy multiflora,

    It sounds like you might need to pass in the post ID to these functions. For instance check out the docs for tribe_show_google_map_link(). As you can see it accepts a postid as the parameter. Pass that in and it should echo the result.

    It could also be a bug in your code. It might not hurt to give it a second go over. For example, on the first line of the code you pasted I noticed you will get unexpected results:

    <h3><a>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0′ ) ); ?>” rel=”bookmark”><?php the_title(); ?></a></h3>

    Notice that there are two closing braces for the opening h3 tag.

    What you are trying to accomplish should be super doable with our API though! Let me know if I can answer any more questions or offer some further guidance on how to implement our API. Thanks!

    – Brook

    #764998
    James Thomson
    Participant

    Yeah I’m not sure why it pasted that way (h3 tag), its correct on my end, so that’s not an issue. And I’m still a little confused, here is my full code, what should I do to pass that in?

    <?php get_header();
    if ( !defined(‘ABSPATH’) ) { die(‘-1’); }
    $venue_id = get_the_ID();
    ?>

    <div id=”content”>

    <div id=”inner-content” class=”nowrap clearfix”>

    <div id=”main” class=”eightcol first clearfix” role=”main”>
    <div id=”inner-main”>

    <article id=”post-<?php the_ID(); ?>” <?php post_class(‘clearfix’); ?> role=”article” itemscope itemtype=”http://schema.org/BlogPosting”&gt;

    <header class=”article-header”>

    <h1 class=”page-title” itemprop=”headline”><?php the_title(); ?></h1>

    </header> <!– end article header –>

    <section class=”entry-content clearfix” itemprop=”articleBody”>
    <?php the_content(); ?>

    <ul class=”venue-list”>
    <?php global $post;
    $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1;
    $upcoming = tribe_get_events( array(
    ‘eventDisplay’=>’upcoming’,
    ‘post_type’=>’tribe_venue’,
    ‘posts_per_page’=>10,
    ‘paged’ => get_query_var(‘page’)
    ) );

    foreach($upcoming as $post) :
    setup_postdata($post); ?>
    <li id=”post-<?php the_ID(); ?>” class=”<?php echo $postclass; ?>”>
    <div class=”fivecol first”>
    <?php if ( has_post_thumbnail()) { ?>
    ” rel=”bookmark” title=”<?php the_title_attribute(); ?>”><?php the_post_thumbnail(); ?>
    <?php } else { ?>
    <?php } ?>
    </div>
    <div class=”sevencol last”>
    <h3>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘twentyten’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h3>
    <div class=”tribe-events-event-meta”>

    <?php if ( tribe_show_google_map_link() ) : ?>
    <!– Google Map Link –>
    <?php echo tribe_get_meta(‘tribe_event_venue_gmap_link’); ?>
    <?php endif; ?>

    <!– Venue Meta –>
    <?php do_action(‘tribe_events_single_venue_before_the_meta’) ?>
    <?php echo tribe_get_meta_group( ‘tribe_event_venue’ ) ?>
    <?php do_action(‘tribe_events_single_venue_after_the_meta’) ?>

    </div><!– .tribe-events-event-meta –>

    <!– Venue Description –>
    <?php if( get_the_content() ) : ?>
    <div class=”tribe-venue-description tribe-events-content entry-content”>
    <?php the_content(); ?>
    </div>
    <?php endif; ?>
    </div>

    <?php
    endforeach;
    ?>

    <?php wp_reset_query(); // reset the query ?>

    </section> <!– end article section –>

    </article> <!– end article –>

    </div>
    </div> <!– end #main –>

    <?php get_sidebar(); ?>

    </div> <!– end #inner-content –>

    </div> <!– end #content –>

    <?php get_footer(); ?>

    #765001
    James Thomson
    Participant

    (ps the reason that h3 tag is off, i think pasting in the code, it tries to render that part as opposed to just showing what I pasted)

    #765495
    Brook
    Participant

    Interesting! Our comment editor is really mucking with our code here. Sorry about that.

    Thanks for pasting the entire code. I see you are using tribe_get_events to try and nab the venues. That’s not quite how it was designed, and might be the source of your problem. It is designed for events, not other post_types. You are also not calling the_post() before hand, which might be complicating things.

    As far as how to pass in the postid, you just retrieve it using the WP API then pass that in as the only argument to the venue specific functions. That link I posted expands on this a bit. This might not actually be necessary though once you get the rest of the things sorted.

    Instead of tribe_get_events, you can just do a WP query for the same post type. From there you can even treat as just a basic WP post, no need to worry about our API if you do not want to learn it. You can checkout the databases wp_postmeta table to see what they are and which ones you you might want to pull it. Some people will find that much easier to do, though not all.

    – Brook

    #809152
    Brook
    Participant

    Since this topic has gone for a spell without a response I am going to archive it. If you do need anything else please feel free to open a new topic. Cheers!

    – Brook

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Making my own Venue list page – how to display venue data’ is closed to new replies.