0

I want to show all my custom posts and category ID=15 in a page. I managed to call my custom posts as follows:

$type = 'my_custom_posts';
    $args=array(
      'post_type' => $type,
      'post_status' => 'publish',
      'posts_per_page' => 5);

How do I get to call, besides my_custom_posts, category ID=15, which is only for normal posts?

2
  • Are you trying to display your custom posts under category ID 15? Commented Aug 20, 2014 at 4:40
  • @Nilambar No, I want to display my custom posts and normal posts that are under category 15 Commented Aug 20, 2014 at 10:40

1 Answer 1

0

I solved the issue very easy.

$type = array('event','post');
            $args=array(
              'post_type' => $type,
              'category' => '8',
              'post_status' => 'publish',
              'posts_per_page' => 5,
              'caller_get_posts'=> 1);

These gets all custom posts 'event' and normal posts from category 8.

1
  • Actually the above code does not work as it takes all posts from every category Commented Aug 26, 2014 at 20:19

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.