0

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?

2
  • 1
    Have you created a custom post type? That isn't completely clear.
    – s_ha_dum
    Commented Dec 12, 2012 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
    Commented Dec 13, 2012 at 10:04

1 Answer 1

0

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);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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