0

I'm looking for an option to show a specific Custom post type on a specific page. In a category there are 10 posts but on the homepage I just want to show for example 3 specific post types of that category. What is the best way to have control over this behavior?

Thanks

0

This way you can make a private listing

function posts_kind($query){

// page id 4173 show

if(is_page('4173')){

// category id 1 show  

$query->set('cat', 1);

return $query;
}

}

add_action('pre_get_posts','posts_kind');
1
  • Thanks, that's a nice solution for a specific template. – Bouke May 15 at 5:54

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.