display address on listing preview page

This topic contains 3 replies, has 3 voices, and was last updated by  Roelien 7 years, 2 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #361614

    Roelien
    Expired Member
    Post count: 7

    Hi,

    I would like to display the address of the listing next to the listing image (and in the sidebar as well). I found out how to do this with the code below. The only problem is that the address is not being displayed on the preview page with this code. How can I solve this?

    
    
    add_action( 'geodir_details_main_content', 'custom_details', 31 );
    
    function custom_details() {
    
    global $post; 
    global $wp_query;
    
    $postid = $wp_query->post->ID;
    
    $current_posttype = geodir_get_current_posttype();
    
    	$hc_address=geodir_get_post_meta($postid,'post_address',true); //address
    
    	echo 'Address:'.$hc_address.';
    }
    #361772

    Paolo
    Site Admin
    Post count: 31206

    Hi Roelien,

    of 6 topics you opened, 5 are about customization. If you need to customize your website but you don’t know how to write the code, you must hire someone. Customization are beyond support.

    https://wpgeodirectory.com/support-policy/

    I flagged your question for the developers and they’ll help you out asap one last time, but if you have ANY other code customization request, please seek for support on codeable.io or upwork.com.

    Thank you,

    #361774

    Giri
    Expired Member
    Post count: 3155
    
    
    add_action( 'geodir_details_main_content', 'custom_details', 31, 1 );
    function custom_details($post) {
        echo 'Address:'.$post->post_address;
    }
    #361863

    Roelien
    Expired Member
    Post count: 7

    Hi Paolo.

    I understand. Thanks for your reply and help!

Viewing 4 posts - 1 through 4 (of 4 total)

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

Open Support Ticket