Details Wordpress Version: 3.4 Theme Deadline Version 1.2 Site URL: littlenomads

Plugin being used to create the Custom Posts Types

1.Types Plugin – Custom Post Types, Taxonomies and Custom Fields 2. Custom Post Template

Problem: I have created a custom post type called "Accommodation" which is working fine. However I can't seem to get the custom post types to show up with the categories it shares and on the home page under one of my blocks.

This piece of code works on the block, however it only pullsthe custom post type and not the other posts that are also tagged under "pictures".

$tz_recent_posts = new WP_Query(); $tz_recent_posts->query('offset=1&post_type=Accommodation,page,post&caller_get_posts=1&posts_per_page=' . $tz_recent_number . '');

Any assistance that anyone can provide is appreciated.

3 Answers 3


Add to your child themes functions file:

function wpsites_add_cpt_home($query) {
if ( !is_admin() && $query->is_main_query() && is_home() ) {
  $query->set('post_type', array( 'post', 'accommodation' ) );


You could also add

category__in => array()

Source pre_get_posts


post_type is case-sensitive, and should be all lower case. Try changing Accommodation to accommodation, see what happens. You might also consider converting your query to arguments to pass to WP_Query() in the first place.


SickHippie might be right about trying lower-case but another error in your query is the use of "caller_get_posts" parameter. This has been deprecated since version 3.1. You should use ignore_sticky_posts instead.

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.