WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

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

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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