Pagination not working
-
I was using a custom WP Query and the pagination was working well. Now I try to show the posts in a more dynamic way (deleting the wp query and the while) by using the get_posts (and foreach) and now the pagination is not working :/ . Any idea how to fix this?
<?php $videos_query = get_posts('category_name=videos&posts_per_page=9&order=DESC'); ?> <?php if($videos_query) : foreach ($videos_query as $post) : setup_postdata($post); ?> <div class="col-md-4" id="col-md-12-videospage"> <article> <?php if(has_post_thumbnail()) : ?> <a href="<?php the_permalink(); ?>" class="thumbnail"> <?php the_post_thumbnail(); ?> </a><?php endif; ?> <a href="<?php the_permalink(); ?>"><h4 id="h4enpagevideosandpageportfolio"><?php the_title();?></h4></a> </article> </div> <?php endforeach; ?> <?php else : ?> <div class="alert alert-danger text-center"><p>Ningun portfolio encontrado</p></div> <?php endif; ?> </div> </div> <!-- Pager --> <div class="clearfix"></div> <ul class="pager"> <li><?php next_posts_link( 'Older'); ?></li> <li><?php previous_posts_link( 'Newer'); ?></li> </ul>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Pagination not working’ is closed to new replies.