Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter daveyh002

    (@daveyh002)

    Have found that there’s a conflict with the Code Snippets plugin.

    These two snippets causing the issue:

    1. Change AJAX filter ordering from default ascending (A-Z, oldest to newest) to descending (Z-A, newest to oldest)

      add_filter(‘tc_caf_filter_posts_order’, ‘tc_modify_ajax_search_query’, 10, 1);
      function tc_modify_ajax_search_query($search_parameters)
      {
      $default_order = “desc”;// Modify the search parameters $search_parameters['order'] = $default_order; // Return the modified search parameters return $search_parameters;
    2. Change AJAX filter ordering from default ‘title’ to ‘date’

      add_filter(‘tc_caf_filter_posts_order_by’, ‘tc_modify_ajax_search_query_2’, 10, 1);
      function tc_modify_ajax_search_query_2($search_parameters)
      {
      $default_order_by = “date”;// Modify the search parameters $search_parameters['orderby'] = $default_order_by; // Return the modified search parameters return $search_parameters;}
Viewing 1 replies (of 1 total)