Skip to main content
7 events
when toggle format what by license comment
Feb 13, 2013 at 1:22 comment added elclanrs @Milo: Oh that clarifies things a bit. Will use pre_get_posts from now on.
Feb 13, 2013 at 1:20 comment added Milo @elclanrs it doesn't work for the same reason. the 404 is from an entirely different query, one based solely on the requested page, not the result of a custom query or call to query_posts. there are certain circumstances where it won't result in a 404, for example if you were to do a custom query within a page post type, but your main posts page and post type or taxonomy archive pages can't reliably have the query modified in the template.
Feb 13, 2013 at 1:20 vote accept elclanrs
Feb 13, 2013 at 1:20 comment added elclanrs @helgatheviking: I got it working with pre_get_posts already I was just wondering why my solution didn't work but anyway it's working now with the hook.
Feb 13, 2013 at 1:17 comment added helgatheviking pre_get_posts is the best way to modify your query anyway as it means you only query the database 1 time instead of adding a second query.
Feb 13, 2013 at 1:04 comment added elclanrs I understand...But why wouldn't it work with a custom WP_query. I tried like this as well: gist.github.com/elclanrs/4782705 but it doesn't even show the prev/next links. Apparently people are getting it working with the solutions I found and a custom query but it doesn't seem to be working for me.
Feb 13, 2013 at 0:48 history answered Milo CC BY-SA 3.0