Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In my blog I'm displaying lists of posts from every category I have in the homepage. I have a column for each category. The code is this:

<?php
$categories = array('3', '4', '5');

foreach ($categories as $category):
?>
        <div class="four columns">
            <h2 id="first_column" class="category_title"><?php echo  get_the_category_by_ID($category); ?></h2>
        <div class="post-list">
<?php 
global $post;
$args = array('numberposts' => '3', 'category' => $category, 'post_status' => array('publish', 'future' ));
$myposts = get_posts($args);

Now I'd need to display also posts occurring in the future. They are called events, I guess. I know I cannot use the wordpress status flag of the posts, because it has another purpose.

I also tried the Event Manager plugin, but I can't find any way to mix these custom posts with the normal ones. Any suggestion?

share|improve this question
1  
Have you created a custom post type? That isn't completely clear. –  s_ha_dum Dec 12 '12 at 23:53
    
The Event Manager plugin creates a custom post type. I just have no clue how to display these posts mixed with the other ones. –  Carlo Dec 13 '12 at 10:04
add comment

1 Answer 1

Add the post type parameter to your get_posts args.

$args = array(
  'numberposts' => '3', 
  'category' => $category, 
  'post_status' => array('publish', 'future' )
  'post_type' => array('post','slug-for-the-event-manager-post-type')
);

$myposts = get_posts($args);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.