• Have a multisite with pods creating custom post type and a simple loop as stated below. However when querying standard post types with custom post types, the custom post types do not get retrieved.

    Any idea what could cause this will be much appreciated.

    eg:
    array( ‘post’, ‘page’ ) = retrieves both
    array( ‘post’, ‘event’ ) = retrieves only post
    array( ‘people’, ‘event’ ) = retrieves both

    Query:
    $args = array(
    ‘post_type’ => array( ‘post’, ‘event’ ),
    ‘orderby’ => ‘date’,
    ‘order’ => ‘DESC’,
    ‘cat’ => -485,
    ‘paged’ => $page
    );
    query_posts( $args );

Viewing 2 replies - 1 through 2 (of 2 total)
  • query_posts is definitely not what you should be using, you should be using $query = new WP_Query( $args );

    As far a post types are concerned, there’s absolutely no reason there should be discrepancies like this when using ‘post_type’ arrays. Pods doesn’t have to hook into this area because WordPress supports it natively, so perhaps the switch above may help somehow.

    Thread Starter poontificate

    (@poontificate)

    Thanks Scott, changing to wp-query solved some other issue I was having. For anyone else having similar issue, realized that Polylang resolves the frontpage a little differently that other pages. I know i should have checked plugins first, newb mistake.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Post Type in Loop Query’ is closed to new replies.