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?

  • Are you trying to display your custom posts under category ID 15? – Nilambar Aug 20 '14 at 4:40
  • @Nilambar No, I want to display my custom posts and normal posts that are under category 15 – Claudiu Creanga Aug 20 '14 at 10:40
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.

  • Actually the above code does not work as it takes all posts from every category – Claudiu Creanga Aug 26 '14 at 20:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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