Problem view pagination [duplicate]

This question already has an answer here:

How to fix pagination for custom loops?

5 answers

I have problems … I try to implement a pagination but it does not work:

<?php
$post_type = ‘automotive’;
$slug = ‘ford’; /* ferrari, peugeot */
$taxonomies = get_object_taxonomies( array( ‘post_type’ => $post_type ) );
foreach( $taxonomies as $taxonomy ) :
$terms = get_terms( $taxonomy );
foreach( $terms as $term ) :
$paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1;
$posts = new WP_Query( “taxonomy=$taxonomy&term=$term->slug&posts_per_page=-1&paged=$paged” );
if( $posts->have_posts() :decepcionado: while( $posts->have_posts() ) : $posts->the_post();
if($term->slug == $slug):
?>

<?php the_title(); ?>

<?php
endif;
endwhile; paginate_links(); endif;
endforeach;
endforeach;
?>

Read more here:: Problem view pagination [duplicate]

Leave a Reply

Your email address will not be published. Required fields are marked *