Timeline for Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
Current License: CC BY-SA 3.0
22 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 22, 2013 at 2:05 | comment | added | hsatterwhite | I've accepted the answer given by @birgire -- works as expected. Thanks to everyone who spent time on this and offered feedback. | |
Apr 22, 2013 at 2:04 | comment | added | hsatterwhite | @AndyAdams, correctomundo sir. | |
S Apr 22, 2013 at 2:03 | history | bounty ended | hsatterwhite | ||
S Apr 22, 2013 at 2:03 | history | notice removed | hsatterwhite | ||
Apr 17, 2013 at 1:56 | vote | accept | hsatterwhite | ||
Apr 16, 2013 at 15:48 | comment | added | Andy Adams | Just double checking - have you added your event_date query var to the "allowed" query vars via the query_vars hook? | |
Apr 16, 2013 at 15:40 | answer | added | birgire | timeline score: 10 | |
S Apr 16, 2013 at 1:30 | history | bounty started | hsatterwhite | ||
S Apr 16, 2013 at 1:30 | history | notice added | hsatterwhite | Canonical answer required | |
Apr 9, 2013 at 1:41 | comment | added | hsatterwhite | Correct. When I request the page and have the query dumped in the main query to see if the SQL is set in $wp_query->request there is nothing. | |
Apr 8, 2013 at 18:57 | comment | added | Scott Kingsley Clark | So to confirm, you say the query does actually get set, but it's not sticking? | |
Apr 8, 2013 at 2:59 | comment | added | hsatterwhite | Indeed it does. Returns the value from the custom query_var. In fact when I var_dump() the $query object itself you can see it plus the meta_query being set. | |
Apr 8, 2013 at 2:23 | comment | added | Scott Kingsley Clark | Does get_query_var( 'event_date' ) actually get any value? | |
Apr 7, 2013 at 21:55 | comment | added | hsatterwhite | Yes, I did that. | |
Apr 7, 2013 at 20:41 | comment | added | ungestaltbar | Did you flush your rewrite rules? Did you try the plugin "Rewrite Rules Inspector" to check if the rule works? | |
Apr 7, 2013 at 18:56 | history | edited | hsatterwhite | CC BY-SA 3.0 |
Corrected syntax.
|
Apr 7, 2013 at 18:10 | comment | added | hsatterwhite | It was, but I took the snippet out removing keywords and forgot to remove references to &$this. Did that so I could post it here for the same of simplicity. | |
Apr 7, 2013 at 17:59 | comment | added | Scott Kingsley Clark | Is this code within a class? Saw a $this reference and wanted to be sure. | |
Apr 7, 2013 at 16:54 | history | tweeted | twitter.com/#!/StackWordPress/status/320942606882320384 | ||
Apr 7, 2013 at 14:23 | comment | added | hsatterwhite | @s_ha_dum, thanks for the edit. I started to use code syntax like you did, but wasn't sure if it was over kill. | |
Apr 7, 2013 at 14:18 | history | edited | s_ha_dum | CC BY-SA 3.0 |
improved code formatting
|
Apr 7, 2013 at 14:09 | history | asked | hsatterwhite | CC BY-SA 3.0 |