Show Posts AND Custom Post Type of same category
-
Hi everybody,
I want to show posts AND Custom Post Type of same category on a page and can′t figure it out. Show either one or the other works, but not both.
My guess was:<?php $paged = (get_query_var('my_category')) ? get_query_var('my_category') : 1; query_posts(array( 'post_type' => array ('my_custom_post_type','posts'), 'paged'=>$paged, )); ?>
, but this only shows the cpt-entries.
In my functions.php:function post_type_projects() { register_post_type('my_custom_post_type', array( 'label' => __('My_custom_post_type'), 'public' => true, 'show_ui' => true, 'taxonomies' => array('category'), 'menu_position' => 5, 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), 'query_var' => true ) ); } add_action( 'init', 'post_type_projects' );
Anybody got a hint how to do this? Thanks in advance.
Uli
- The topic ‘Show Posts AND Custom Post Type of same category’ is closed to new replies.