• Resolved Stefan

    (@stefan83)


    Hi I’m trying to query a post type (project) but its not returning any results. Any ideas? Thanks

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('post_type=project'.'posts_per_page=5'.'&paged='.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('post_type=project&posts_per_page=57&paged='.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>

    You are running the incorrectly.. The format you are using would look like this:

    post_type=projectposts_per_page=5&paged='.$paged

    Simple PHP mistake

    Thread Starter Stefan

    (@stefan83)

    I see. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query post type not working’ is closed to new replies.