I am creating a site which uses normal posts for a blog and the a custom post type for events(generated by the events plugin). I have successfuly used different queries to grab both but I want to combine them into one query. Have tried various things with no luck.
Here is query for blog:
<?php $mainFeatures = array( 'numberposts' => -1, 'order'=> 'DESC', 'orderby' => 'post_date');
$postslist = get_posts( $mainFeatures );
foreach ($postslist as $post) : setup_postdata($post); ?>
<!-- stuff from post-->
<?php endforeach; ?>
Here is query for events:
<?php query_posts(array('post_type'=>array(TribeEvents::POSTTYPE), 'numberposts' => -1,'order' => 'ASC')); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- stuff from post-->
<?php endwhile;?>
Have tried this but again only gets the events:
<?php $tryone = query_posts(array('post_type'=>post, 'posts_per_page'=> 18)); ?>
<?php $trytwo = query_posts(array('post_type'=>array(TribeEvents::POSTTYPE))); ?>
<?php $all_posts = array_merge( $tryone, $trytwo ); ?>
<?php query_posts($all_posts); ?>
<?php while (have_posts()) : the_post(); ?>
<p>stuff</p>
<?php endwhile;?>
I think you are using the wrong
post_type
for regular posts.