php - How to paginate results with Custom Post Types on WP? -


It has been asked before WP forums, but none of the solutions has worked for me, I reset permalinks Have done etc. no point. I hope you have the answer to the people. This is my setup:

I have a custom post type named ted_venue, and two templates, single-ted_venue.fp (single site description) and page-place.fp (list of locations To display). Permalink is site.com/venues/venue-slug for site information and site.com/venues for place listing.

This is the paging code on the list of locations:

  $ paged = get_query_var ('paged')? Get_query_var ('paged'): 1; $ Wp_query = New WP_Query (array ('post_type' = & gt; 'ted_venue', 'paged' = & gt; $ paged, 'posts_per_page' => 30)); If ($ wp_query-> is_poz ()):? & Gt; & Lt; Ul & gt; & Lt ;? While php ($ wp_query-> is_poz ()): $ wp_query-> The_post (); ? & Gt; ...  

Then on the bottom I add some page link links. If I go to site.com/venues/page/2, then it brings a 404 error.

Then, if I reset the permalinks for the default and then for the present, it is ok to point out the place-listing page, but the description of the single place 't. So, basically when pointing to the page works as a space and does not have the opposite.

Does anyone have a clue what is happening or at least you can tell me about an article or an example of live work?

Thank you!

OK, here's why it's not working:

Paged ', while WordPress still thinks it's on a static page, so the endorsement will always be 1. Unfortunately, there is no way to do this that you are doing right now, but still other solutions.

There are basically two ways to fix them: First of all, you can override the rewriting rules that your post type is generating itself (this is the best way, but it The most complex, and putting out just days of work is how the rewriting engine actually works) Second way (this simple method that works perfectly, but this is not necessarily the best way) Here are Matt Voibay Sector 'Using your custom post type "code:


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -