Support » Plugins » Hacks » How to Add Page Navigation at the end of a Page

  • I have created a page, and i want to add 10 posts from a specific category on this page. I have no issue in doing so. But now i want to add a wp pagenavi at the end of those 10 posts from a specific category. So reader can navigate to rest of the articles from that category on the same page. But i don’t know how to do it, can someone help me in this regard. Thank You.

    I want to do same thing as it is appearing on this page.
    http://goo.gl/TfjjJA

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You will want to run a custom WP_Query and corresponding loop. The specifics can be found at Class Reference/WP Query. The loop would output the post title in <a> tags, much like an index or archive page, except without the usual excerpt and meta data.

    There’s a few ways to implement this on your page. One way is by creating a shortcode. The problem is you probably do not want to repeat the 10 posts already on the page. Passing what those posts are to a shortcode is quite awkward. I thus will suggest you create a custom page template for this page. The first part will be much like the default template, except in the loop you will collect the post IDs output into an array.

    That array is used in the second query with the ‘post__not_in’ argument to prevent duplicate listings.

    Actually i don’t know coding. So can you please give me the code which i can use to show 10 posts from a specific category and at the end of those 10 posts the page navigation appear? I am using wp-pagenavi Plugin in my blog.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to Add Page Navigation at the end of a Page’ is closed to new replies.