Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hi I have a custom post type and its posts are called via a shortcode on any other post or page.

I'd like to paginate this post type, say display 10 items. So the page in the URL remains the same, but the content inside (via shortcode) changes when I go to the 2nd page from the pagination buttons.

How do I do this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try to do a little research. This is documented all over the googlesphere.

http://css-tricks.com/snippets/wordpress/paginate-custom-post-types/

http://wordpress.org/support/topic/custom-post-type-taxonomy-pagination?replies=14

share|improve this answer
    
So since the query is being run inside a particular post or page, would pagination still work leaving the rest of the page unaffected and using the same URL? –  drtanz Aug 26 '12 at 21:48
    
@drtanz You would probably want to pass the argument for what page you are on, whether that's through $_GET or $_POST is entirely up to you. I'd suggest GET. To do that, check out add_query_arg to add the argument. You would check for that variable being passed where you render your shortcode. –  Eric Holmes Aug 28 '12 at 20:31
    
Link only answers are considered poor quality. Please explain why those posts are useful and how to achieve it. Thanks. –  kaiser Mar 13 '13 at 14:43
    
This resolved ticket is 7 months old, I don't see how it's relevant any longer. People should do ample research before posting a question here, anyways. The answer is clearly explained in those links - they aren't just to Codex pages. –  Eric Holmes Mar 13 '13 at 20:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.