Echo Post Meta Fields

This topic contains 2 replies, has 3 voices, and was last updated by  Naveen Giri 4 years, 10 months ago.

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

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #530922

    Gabe Dickens
    Expired Member

    I am making a custom template file and want to echo out meta from a GeoDirectory place. The code below will display the ZIP.

    get_post_meta( get_the_ID(), 'geodir_zip', true);

    Strangely enough, the following doesn’t return the zip as part of the array at all.

    get_post_meta( get_the_ID() );

    I need to echo the address, state, zip, phone, and more. But, I cannot find a list of those meta fields, nor can I seem to dump all of the keys out at once. Any ideas?

    #530928

    Alex Rollin
    Moderator
    Post count: 27815

    You are on the track for the normal GD Custom Fields. Address parts are special, I will ask the developers to comment on that.

    https://wpgeodirectory.com/docs-v2/faq/customizing/#listing-data

    #530959

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Gabe,

    if you want to grab multiple meta keys value of a gd post.
    you can use the $gd_post global variable.

    
    
    
    	global $gd_post;
    	echo $gd_post->zip;
    	echo $gd_post->phone;
    

    currently array of meta values using

    get_post_meta( get_the_ID() );

    is not integrated.

    Thanks

Viewing 3 posts - 1 through 3 (of 3 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