WordPress.org

Ready to get started?Download WordPress

Forums

wp_query with multiple custom post type is not working (1 post)

  1. Iperdesign_IT
    Member
    Posted 2 years ago #

    Hello all, i have this simple code:

    $blog = new WP_Query( array(
    	'post_type' => array( 'eventi' , 'locali' ),
    	'posts_per_page' => 6 ,
    	'post__not_in' => get_option( 'sticky_posts' ),
    	'paged' => $paged
    	)
    );

    Of course i declared both 'eventi' and 'locali' post types. In fact, if i use one of them, the loop works fine. But if use both of them, no posts are showed. Even if i use just this other code:

    $blog = new WP_Query( array(
    	'post_type' => array( 'eventi' , 'locali' ),
    	)
    );

    No posts are showed. What should i do? Thanks!!! :)

Topic Closed

This topic has been closed to new replies.

About this Topic