Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the following basic code:

    <?php get_header(); ?>
<?php

$args = array(
'status'        => 'publish',
'post_type'     => 'radio',
'orderby'       => 'date',
'order'         => 'ASC',
'posts_per_page' => -1
);
// The Query
$query = new WP_Query( $args );

// The Loop
if ( $query->have_posts() ) {
    while ( $query->have_posts() ) {
        $query->the_post();
        echo '<li>' . get_the_title() . '</li>';
    }
} else {
    // no posts found
}
/* Restore original Post Data */
wp_reset_postdata();?>


<?php get_footer(); ?>

and run it (under taxonomy.php) and I gets only one post - I have lot of 'radio' poststypes. What it worng here? Thanks!

share|improve this question
1  
Do "radio" post types have titles? Why not try debugging inside your loop a little, or debugging your query. Try, after $query is defined, typing "var_dump($query);" and see what comes up. –  GhostToast Jul 19 '13 at 18:14
    
yes the all 'radio' posts has a title. –  user34406 Jul 19 '13 at 18:18
    
And how and what can I debug here? It's saw me only the 1st post :( –  user34406 Jul 19 '13 at 18:19
    
Should not "status" be the "post_status"? codex.wordpress.org/Class_Reference/WP_Query#Status_Parameters –  M-R Jul 19 '13 at 18:35
    
That should work despite the status issue mentioned by @M-R (and which should be corrected). Do you have any filters that are altering posts_per_page? –  s_ha_dum Jul 19 '13 at 18:48

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.