0

I have a blog page in my wordpress site http://jarm.shahumyanmedia.com/blog/. Here the blogs are posts, and I need to display 5 posts for each page, but I can't display pagination link.

This is how I am getting posts:

$posts = get_posts( array(
    'posts_per_page' => 5,
    'orderby' => 'date',
    'order' => 'DESC',
    'category' => 5)
);

And this is how I am trying to get pagination links:

<?php wp_link_pages(); ?>

http://codex.wordpress.org/Template_Tags/wp_link_pages

But I don't see any output.

Danila Ganchar
  • 10,266
  • 13
  • 49
  • 75
Anna Gabrielyan
  • 2,120
  • 3
  • 28
  • 48
  • Your second code paste is missing. And did you check this: http://stackoverflow.com/questions/5864578/paginate-posts-in-wordpress-theme?rq=1 – Luceos Apr 18 '14 at 07:50

1 Answers1

0

Install and active this plugin and add this code..

http://www.devdevote.com/cms/wordpress-plugins/wp-paging

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts('paged='.$paged.'&posts_per_page=5&orderby=date&cat=5&order=DESC');
while (have_posts()) : the_post();
  ....

endwhile;
wp_paging();
Win More
  • 287
  • 1
  • 6
  • 21