Kiran

Forum Replies Created

Viewing 15 posts - 3,841 through 3,855 (of 6,022 total)
  • Author
    Posts
  • in reply to: Custom Field Number 0 different than Null #438444

    Kiran
    Moderator
    Post count: 7069

    In preview geodir_get_post_meta() will not work, so you have to use global $post;
    Ex:

    
    
    <td>
    	<?php global $post; if ( ! empty( $post->geodir_min_asistentes_escuela ) ) { ?>
    	echo $post->geodir_min_asistentes_escuela;
    	<?php } else { ?>
    	No Disponible
    	<?php } ?>
    </td>

    Kiran

    in reply to: date setting does not function #438418

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Issue has been fixed. It seems you have translated am, pm to blank text and it was breaking date translation/un-translation.

    I have fixed it from our end.

    Thanks,
    Kiran

    in reply to: Custom Field Number 0 different than Null #438373

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Custom Field Number 0 different than Null #438359

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Add listing address filter or action #438358

    Kiran
    Moderator
    Post count: 7069

    Hello,

    You have to create field from GeoDirectory > CPT Settings (eg: Place Settings).
    Create field with html var name (key) = custom_address. Reason behind adding field via field manager is you do not need to write any extra code to save field on submit listing.

    There is a chance that field may display twice on form. One via manually by my snippet and one via custom field manager. You can hide field that will be displayed via field manager by using hook: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/custom_fields_input_functions.php#L78

    Kiran


    Kiran
    Moderator
    Post count: 7069

    Hello Jen,

    Please provide us FTP credentials so we can do some debugging to find issue.

    Kiran

    in reply to: Add listing address filter or action #438256

    Kiran
    Moderator
    Post count: 7069

    Hi,

    Here is example to add custom field under address field:

    
    
    function _gd_custom_extra_address_field( $custom_field ) {
    	?>
    	<div id="geodir_custom_address_row" class="geodir_form_row clearfix gd-fieldset-details">
    		<label><?php _e( 'Custom Address', 'geodirectory' ); ?></label>
    		<input field_type="text" name="geodir_custom_address" id="geodir_custom_address" class="geodir_textfield gd-form-control" type="text">
    		<span class="geodir_message_note"></span>
    	</div>
    	<?php
    }
    add_action( 'geodir_address_extra_listing_fields', '_gd_custom_extra_address_field', -10, 1 );

    Thanks,
    Kiran

    in reply to: Custom Field Number 0 different than Null #438224

    Kiran
    Moderator
    Post count: 7069

    Hello,

    Use following code snippet to display “Not Available” instead of empty or 0 value for particular field.

    
    
    function _gd_custom_set_not_available( $html, $location, $cf, $p = '' ) {
    	if(is_int($p)){$post = geodir_get_post_info($p);}
        else{ global $post;}
    
    	if ( ! empty( $post ) && in_array( $cf['htmlvar_name'], array_keys( (array) $post ) ) ) {
    		$field_value = $post->{$cf['htmlvar_name']};
    
    		if ( $field_value === NULL || $field_value === '' ) {
    			$value = __( 'Not Available', 'geodirectory' ); // null or empty
    		} else if ( $field_value === 0 || $field_value === '0' ) {
    			$value = __( 'Not Available', 'geodirectory' ); // 0 (zero)
    		} else {
    			$value = $field_value; // > 0
    		}
    
    		$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
    		$field_icon = geodir_field_icon_proccess($cf);
    		if (strpos($field_icon, 'http') !== false) {
    			$field_icon_af = '';
    		} elseif ($field_icon == '') {
    			$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
    		} else {
    			$field_icon_af = $field_icon;
    			$field_icon = '';
    		}
    
    		$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
    		$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
    		$html .= '</span>';
    		$html .= $value;
    		$html .= '</div>';
    	} else {
    		$html = '';
    	}
    	
    	return $html;
    }
    add_filter( 'geodir_custom_field_output_text_var_geodir_capacity', '_gd_custom_set_not_available', 10, 4 ); // Replace "geodir_capacity" with your field name

    NOTE: Replace “geodir_capacity” with your field name in last line of snippet

    Thanks,
    Kiran

    in reply to: Add listing address filter or action #438209

    Kiran
    Moderator
    Post count: 7069

    Hi James,

    Please provide us some more details how you want it, so i can help you with that if it is achievable via action/filter.

    Kiran

    in reply to: WPML #438144

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    in reply to: Detail page breaking with Divi #438132

    Kiran
    Moderator
    Post count: 7069

    Hi Kevin,

    The breadcrumb link issue has been fixed.
    The was conflict with Yoast SEO addon. We have fixed it and it will be available in next release.
    You can find patch here: https://github.com/GeoDirectory/geodirectory/commit/7d59c1c23dc5271c4404bba86e9dde3e3d6360e9

    Thanks,
    Kiran


    Kiran
    Moderator
    Post count: 7069

    Hi,

    Your theme style conflicting with the GD pages. I have added style in style.css to fix login page content.

    Please check and let us know.

    Kiran


    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.

    Kiran
    Moderator
    Post count: 7069

    Please check now.

    I have added following style in style.css to fix this.

    
    
    #main-content:after {
    	clear: none;
    }
Viewing 15 posts - 3,841 through 3,855 (of 6,022 total)
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount