Johnwromine
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
You have to do a little more work, but it works great!
<?php $FieldsName = get_post_meta($post->ID, 'FieldsName', true); if(!empty($FieldsName)) foreach( $FieldsName as $FieldName){ if (qtrans_getLanguage() == 'en' ) { echo '<h5><a>' . $FieldName['question'] . '</a></h5> <div class="">' . $FieldName['anwser'] . '</div>'; } elseif ( qtrans_getLanguage() == 'zh' ) { echo '<h5><a>' . $productfaq['question-zh'] . '</a></h5> <div class="">' . $productfaq['anwser-zh'] . '</div>'; }; }; ?>You can try this, it worked for me!
<?php $loop = new WP_Query( array( 'post_type' => 'tribe_events', 'posts_per_page' => 2 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php get_post_meta($post->ID, 'events', true); ?> <?php endwhile; ?> <!----Upcoming Events----> <?php global $post; $upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>2 ) ); foreach($upcoming as $post) : setup_postdata($post); //post title echo '<div class=" event-post-thumb"><h4><a href="'; the_permalink(); echo '">'; the_title(); echo '</h4>'; //post date echo '<p>'; echo tribe_get_start_date( $post->ID, false, 'D. M j, Y' ); echo '</p>'; //post thumbnail and excerpt if ( has_post_thumbnail() ) { echo '<a href="';the_permalink();echo '"> <div class="" >';the_post_thumbnail('small-list-thumbnail');echo '</div></a>'; echo '<div class="fr">'; the_excerpt();} else {echo the_excerpt(); echo '</div>'; } endforeach; ?>
Viewing 2 replies - 1 through 2 (of 2 total)