Ross
Forum Replies Created
Viewing 10 posts - 10,151 through 10,160 (of 10,351 total)
-
Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 5:56 pm #1707This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 5:28 pm #1704This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 5:25 pm #1703This reply has been marked as private.Ross Moderator in reply to:
Translation of "All" terms not working(Private) June 18, 2014 at 5:01 pm #1702Oh ok I thought this worked, can you work around this for now? I will have to get WPML set up again and get testing.. Hopefully I will be able to push a plugin update tomorrow with the fix.
Thanks
Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 4:39 pm #1696This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 4:03 pm #1693This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 3:17 pm #1688This reply has been marked as private.Ross Moderator in reply to:
Post-meta not taking into account(Private) June 18, 2014 at 1:55 pm #1685This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 1:54 pm #1684This reply has been marked as private.Ross Moderator in reply to:
Restrict results to date range(Private) June 18, 2014 at 1:03 pm #1681Hey Philip, sorry I’m a bit confused, is the code working? I just realised that this code would apply to all queries on your site, and not just S&F, so I would update it with this:
add_action( 'pre_get_posts', 'filter_post_dates', 21 ); function filter_post_dates($query) { global $sf_form_data; if ( !is_admin() && $query->is_main_query() && $sf_form_data->is_valid_form() ) { $query->set( 'order', 'ASC' ); $query->set( 'orderby', 'date' ); add_filter( 'posts_where', 'after_date_filter'); } return $query; } function after_date_filter( $where = '' ) { $today = date( 'Y-m-d' ); $where .= " AND post_date <= '$today'"; return $where; remove_filter( 'posts_where', 'after_date_filter'); }
But just to note, this code only applies once you have pressed search once on your form (even if its blank)…
-
AuthorPosts