Your address will show here +12 34 56 78

Home Forums WP ESTATE – Real Estate WordPress Theme FORUM Change property_bedrooms

This topic contains 4 replies, has 2 voices, and was last updated by  Joakim 3 years, 6 months ago.

  • Author
    Posts
  • #27745

    Joakim

    Hi

    Sorry for the huge amounts of questions…

    Is there a way to change property_bedrooms to, instead of only allowing numbers, a free text field.

    I have changed property_bedrooms to be the Object-ID and if the ID is 513-DD it only displays 513.

    I hope you know what i mean.

    Regards
    Joakim

  • #27922

    Anna
    Keymaster

    Hi Joakim,

    I need team’s assistance on this. It’s a technical question. Will reply by Monday!

    Thank you
    Anna

  • #28328

    crerem

    The property_bedrooms is forced by the system to be a integer number. If you change this the search results that involve bedrooms will not work corectly.

    If you still want to change this to the text format you should search in the theme folder for all occurences of property_bedrooms and where you see

    $property_bedrooms = floatval ( get_post_meta($post->ID, ‘property_bedrooms’, true) );

    or

    $property_bedrooms = intval ( get_post_meta($edit_id, ‘property_bedrooms’, true) );

    replace intval or floatval with esc_html

    Also i suggest to consider using a custom field rather than doing this change.
    Before doing any change make a backup – just in case things not work well.

    Good luck

  • #28330

    Joakim

    Thank you for the answer. The thing is that that in Sweden we only count rooms, not bedrooms.

    Best regards
    Joakim

  • #28499

    Joakim

    The custom fields worked great! Thanks!

    Regards
    Joakim

You must be logged in to reply to this topic.