Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
2 added 5 characters in body
source | link

I have to get some custom post types and need to do that with WP_Query (query_posts doesn't work).

How can I do the pagination? Whatever I tried didn't work... any help would be awesome I can't crack this alone...

$args = array(
'tax_query' => array(
   'posts_per_page' => 5,
    array(
    'author' => $user_id,
        'taxonomy' => 'custom_taxtype',
        'field' => 'slug',
        'terms' => 'delicious-food',
        'posts_per_page' => 5
    )
) 
); 
$answer_query = new WP_Query( $args );

//// Loop trough the results

while ( $answer_query->have_posts() ) : $answer_query->the_post();

//// do something

endwhile;

I have to get some custom post types and need to do that with WP_Query (query_posts doesn't work).

How can I do the pagination? Whatever I tried didn't work... any help would be awesome I can't crack this alone...

$args = array(
'tax_query' => array(
    array(
    'author' => $user_id,
        'taxonomy' => 'custom_taxtype',
        'field' => 'slug',
        'terms' => 'delicious-food',
        'posts_per_page' => 5
    )
) 
); 
$answer_query = new WP_Query( $args );

//// Loop trough the results

while ( $answer_query->have_posts() ) : $answer_query->the_post();

//// do something

endwhile;

I have to get some custom post types and need to do that with WP_Query (query_posts doesn't work).

How can I do the pagination? Whatever I tried didn't work... any help would be awesome I can't crack this alone...

$args = array(
'tax_query' => array(
   'posts_per_page' => 5,
    array(
    'author' => $user_id,
        'taxonomy' => 'custom_taxtype',
        'field' => 'slug',
        'terms' => 'delicious-food',
    )
) 
); 
$answer_query = new WP_Query( $args );

//// Loop trough the results

while ( $answer_query->have_posts() ) : $answer_query->the_post();

//// do something

endwhile;
1
source | link

WP_query and pagination?

I have to get some custom post types and need to do that with WP_Query (query_posts doesn't work).

How can I do the pagination? Whatever I tried didn't work... any help would be awesome I can't crack this alone...

$args = array(
'tax_query' => array(
    array(
    'author' => $user_id,
        'taxonomy' => 'custom_taxtype',
        'field' => 'slug',
        'terms' => 'delicious-food',
        'posts_per_page' => 5
    )
) 
); 
$answer_query = new WP_Query( $args );

//// Loop trough the results

while ( $answer_query->have_posts() ) : $answer_query->the_post();

//// do something

endwhile;