No longer searching

Forums › Forums › Search & Filter Pro › No longer searching

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #82378

    All of a sudden the search forms have stopped sorting. The page is here: https://intrepidexposures.com/photo-tours/

    Tweaks to code as per previous threads here:

    // Search Filter
    function filter_input_object($input_object, $sfid) {
    	
    if(($input_object['name'] == '_sfm_workshop_location') || ($input_object['name'] == '_sfm_tour_style') || ($input_object['name'] == '_sfm_tour_leader')) {
    
    		
    		$new_options = array(); //the options added to this will replace all existing optoins in the field
    		
    		foreach($input_object['options'] as $option) {
    			
    			if ($option->value !== "")
    			{
    				//check to see if the option has a parent
    				$parent_id = wp_get_post_parent_id($option->value);
    				if(!$parent_id)
    				{
    					//then this option does not have a parent, so it must be a parent itself, add it to the new array
    					$option->label = get_the_title($option->value);
    					array_push($new_options, $option);
    				}
    			}
    		}
    		
    		//now we have an array with only parent options in, so simply replace the one in the input object
    		$input_object['options'] = $new_options;
    		
    	}
    	
    	return $input_object;
    }
    add_filter('sf_input_object_pre', 'filter_input_object', 10, 2);

    Any ideas?

    Trevor
    #82555

    Which version of the plugin do you have installed? Is it 2.3.0? If not, please update that.

    Note that this latest version of S&F Pro now supports relationship fields in ACF and ACF Pro (so where you might before have had to use the ID number of an option, you can now use its actual value). In your case, for example.

    You have a meta key called workshop_location where ID 350 is actually Central Asia & The Caucasus, but I see the query in the url shows this still as:

    ?_sfm_workshop_location=313

    I do not think that this is the issue, but worth checking.

    The other thing I note is that the results container looks wrong. It is set to #main and I think it should be .content

Viewing 2 posts – 1 through 2 (of 2 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.