Title: Display events using query_posts
Last modified: August 9, 2018

---

# Display events using query_posts

 *  Resolved [MrMyles](https://wordpress.org/support/users/mrmyles/)
 * (@mrmyles)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/display-events-using-query_posts/)
 * I am using an old custom built template, works perfect for what we need.
    We 
   just started using this event calendar and would like to display our events alongside
   our posts feed.
 * Our posts feed displays on a couple of pages and is hard coded into our template.
   It displays posts from a certain category. We would like to include our Tribe
   Events in that category or expand the code to include Tribe Events.
    Is this 
   possible?
 * Our code:
 *     ```
       <?php query_posts('cat=665&showposts=12'); ?>
   
           			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
                           <div class="large-4 medium-4 columns events_wrap">  
                               <li>
   
                                   <?php if(get_field('feature_image')) : ?>
       								<?php $attachment_id = get_field('feature_image'); $size = "front-page-news"; $image = wp_get_attachment_image_src( $attachment_id, $size ); ?>
                                   	<img src="<?php echo $image[0]; ?>" alt="Image of <?php the_title(); ?>" class="feature_image"/>
                                   <?php else: ?>
                                   	<div class="placeholder"><?php echo wp_get_attachment_image( 856, 'front-page-news' ); ?></div>
                                   <?php endif ?>
   
                                   <div class="row collapse">
                                       <div class="large-4 medium-4 small-4 columns">
   
       									<?php if(get_field('date')) : ?>
                                           <div class="date_posted">
       										<small>Event Date</small>
                                               <?php $date = strtotime(get_field('date')); ?>
                                               <h3><?php echo date('M', $date); ?></h3>                                
                                               <p><?php echo date('d/y', $date); ?></p>
                                           </div>  
                                           <?php else: ?>
                                           <div class="date_posted">
       										<small>Posted On</small>
                                               <h3><?php the_time('M') ?></h3>
                                               <p><?php the_time('j/y') ?></p>
                                           </div>     
                                           <?php endif ?>
   
                                       </div>    
                                       <div class="large-8 medium-8 small-8 columns">
       									<p><?php echo excerpt(10); ?></p>
                                           <a href="<?php esc_url( the_permalink() ); ?>" title="Permalink to <?php the_title(); ?>" rel="bookmark">MORE</a>
                                       </div>
                                   </div>   
                               </li>
                           </div>
                       <?php endwhile; ?> 
       ```
   

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

 *  [Ed](https://wordpress.org/support/users/erishel/)
 * (@erishel)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/display-events-using-query_posts/#post-10582607)
 * Hey there **[@mrmyles](https://wordpress.org/support/users/mrmyles/)**!
 * Thanks for reaching out — that’s a great question, I can help with that 🙂
 * You’ll want to take advantage of our helper function [tribe_get_events()](https://theeventscalendar.com/knowledgebase/using-tribe_get_events/)
 * To do what you’re asking, a custom query will need to be crafted — which is something
   that is beyond the scope of our free support. Our [Functions list](https://theeventscalendar.com/functions/)
   may help you along the way.
 * Good luck!
    Ed ✌️
 *  [Ed](https://wordpress.org/support/users/erishel/)
 * (@erishel)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/display-events-using-query_posts/#post-10633420)
 * Hey there,
 * Since this thread has been inactive for a while, I’m going to go ahead and mark
   it as resolved. Don’t hesitate to create a new thread any time you help again!
 * Ed 🙂

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

The topic ‘Display events using query_posts’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Ed](https://wordpress.org/support/users/erishel/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/display-events-using-query_posts/#post-10633420)
 * Status: resolved