Your address will show here +12 34 56 78

Home Forums Custom Work How to change number_format to text

This topic contains 2 replies, has 2 voices, and was last updated by  Anna 2 years, 1 month ago.

  • Author
    Posts
  • #117265

    patymorgh
    Participant

    Hi

    I need some help here.
    How can I change the way property size shows at frontend ?
    All I can do is change ft to m², but the size I need has letters (2LDK, 1DK and so on). So, at frontend, it shows just the numbers (2, 1 and so on)
    On my Latest Properties, I want to replace that m² size to these sizes.

    Thank you

  • #117271

    patymorgh
    Participant

    I found some codes about it, but I’m not sure what to replace:

    At property_unit.php and in property_unit_half.php=

    $property_size=number_format(floatval($property_size));

    —————————————-

    At property.php=
    <td width=”33%” valign=”top” align=”left”>
    <p class=”meta-options”>
    <label for=”property_size”>’.__(‘Size: ‘,’wpestate’).'</label><br />
    <input type=”text” id=”property_size” size=”40″ name=”property_size” value=”‘ . esc_html(get_post_meta($mypost, ‘property_size’, true)) . ‘”>
    </p>
    </td>

    ————————————–

    At theme_slider.php =

    $size = number_format (intval ( get_post_meta($theid, ‘property_size’, true) ) );

    ————————————-

    At listing_functions.php =

    if ( isset($plan_size_array[$key]) && $plan_size_array[$key]!=”){
    $plan_size=__(‘size:’,’wpestate’).’ ‘.$plan_size_array[$key].’ ‘.$unit.'<sup>2</sup>’;
    }else{
    $plan_size=”;

  • #117884

    Anna
    Keymaster

    Hi

    This requires you change the number type from number to text.

    It’s the same process as here http://wpestate.org/forums/topic/change-price-field-to-text/

    But for the property_size field.

    Thank you
    Anna

The forum ‘Custom Work’ is closed to new topics and replies.