Forums › Forums › Search & Filter Pro › Settings & Default / Post (wrong default order)
- This topic has 21 replies, 3 voices, and was last updated 7 years, 11 months ago by Anonymous.
-
Anonymous(Private) November 14, 2016 at 6:30 pm #70250
I just want my result in order of date on this page
http://dev-patriote.erod.ca/programmation/But I cannot understand why 5 of them aren’t in the good order.
Anonymous(Private) November 17, 2016 at 4:37 pm #70903Hi,
thanks for your help!!!
It wasn’t the wpml plugin,
but the custom code (that I was sure it wasn’t in cause)
I had to add the bold section here to make it workfunction sf_filter_query_args( $query_args, $sfid ) { if($sfid==1225){ global $searchandfilter; $sf_current_query = $searchandfilter->get(1225)->current_query(); $sf_current_query->get_field_string("_sfm_event_archives"); $_sfm_event_archives_array = $sf_current_query->get_array(); $archive_is_check = $_sfm_event_archives_array[_sfm_event_archives][active_terms][0][value]; //print_r($archive_is_check); if($archive_is_check != '1'){ $args_custom = array( <strong>"meta_key" => "imic_event_start_dt", "orderby" => "meta_value_num", "order" => "ASC",</strong> "meta_query" => Array ( "event_archives" => Array ( "key" => "event_archives", "value" => "0" ) ) ); $query_args = array_merge($query_args, $args_custom); } // si aucun filtre d'appliqué //if($sf_current_query->is_filtered()!=1){} } return $query_args; } add_filter( 'sf_edit_query_args', 'sf_filter_query_args', 100, 2 );
Thanks again for your help guys!
Really nice plugin!Anonymous(Private) November 17, 2016 at 4:38 pm #70909function sf_filter_query_args( $query_args, $sfid ) {
if($sfid==1225){
global $searchandfilter;
$sf_current_query = $searchandfilter->get(1225)->current_query();$sf_current_query->get_field_string(“_sfm_event_archives”);
$_sfm_event_archives_array = $sf_current_query->get_array();
$archive_is_check = $_sfm_event_archives_array[_sfm_event_archives][active_terms][0][value];//print_r($archive_is_check);
if($archive_is_check != ‘1’){
$args_custom = array(
“meta_key” => “imic_event_start_dt”,
“orderby” => “meta_value_num”,
“order” => “ASC”,
“meta_query” => Array (
“event_archives” => Array (
“key” => “event_archives”,
“value” => “0”
)
)
);$query_args = array_merge($query_args, $args_custom);
}// si aucun filtre d’appliqué
//if($sf_current_query->is_filtered()!=1){}}
return $query_args;
}
add_filter( ‘sf_edit_query_args’, ‘sf_filter_query_args’, 100, 2 ); -
AuthorPosts