Edit .php Geodirectory

This topic contains 1 reply, has 2 voices, and was last updated by  Paolo 8 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #373763

    thepermittech
    Expired Member
    Post count: 19

    Hello, this php file (geodirectory/geodirectory-functions/custom_fields_output_functions.php) file outputs custom fields entered within the theme. I’ve pasted some of the code below where it outputs the address. I am going to remove some of the <br> and add in some commas to make the address format look more standard. I don’t want to lose this if there is an update. I’ve tried to follow some of the other forums, but not quite understanding where to put the modified function and what to do with the old one. Function is: function geodir_cf_address($html,$location,$cf,$p=”)

    
    
                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
                $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
                $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
                $html .= '</span>';
    
                if ( isset($post->post_address) ) {
                    $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
                }
                if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
                    $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
                }
                if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
                    $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
                }
                if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
                    $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
                }
                if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
                    $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
                }
                $html .= '</div>';
    #373916

    Paolo
    Site Admin
    Post count: 31211
Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount