Support

Account

Home Forums General Issues Setting up front end filtering and sorting by custom fields Reply To: Setting up front end filtering and sorting by custom fields

  • Hi @lewmaster
    It looks liek the issue is coming from the ACF field not being found. Can you please debug the $field variable like so:

    
    $field = get_field_object('bedrooms');
    echo '<pre>';
    	print_r( $field );
    echo '</pre>';
    

    My guess is that ACF does not know where to find the field. The get_field_object function will only work if a value has already been saved to the current $post.

    If your code is not run on single post page, then ACF will not be able to load the field. Perhaps you will need to change bedrooms to the field_key.

    using the field_key removes the need to lookup the value => key relationship.

    Thanks
    E