Timeline for Query with pre_get_posts to get pagination
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2012 at 20:39 | comment | added | MathSmath | @WouterB Sorry for the misunderstanding--I didn't mean to suggest that setting those two vars is all that's needed to get the result you want--I'm not exactly sure what that is. But that example is definitely how you set query params using pre_get_posts (in answer to your question #1). How to set query params and how to get exactly the result you're after are two different questions :) I still think your best bet is to figure out if there's a native query/template combo that fits your needs. As I said, it looks like a basic post type archive for a custom post type. Is that what you want? | |
Jun 10, 2012 at 13:24 | comment | added | WouterB |
using what you describe results in a 404 page. function bwpm_pre_get_posts($query){ if(!$query->get('posts_page_page')) $query->set('posts_per_page',1); $query->set('post_type','trips'); } add_action('pre_get_posts','bwpm_pre_get_posts');
|
|
Jun 10, 2012 at 1:34 | history | answered | MathSmath | CC BY-SA 3.0 |