GeoDirectory SupportHow do I get the value of a custom field programatically – GeoDirectory Support https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/feed Mon, 16 Mar 2026 11:10:20 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24922 <![CDATA[How do I get the value of a custom field programatically]]> https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24922 Thu, 18 Dec 2014 21:37:33 +0000 nitefader How can I get the value of a custom text field I have called instagram with a value of myinstagram?

example here ==> http://www.vipbottlelife.com/places/united-states/georgia/atlanta/night-club/magic-city/#post_profile

i tried: $post->geodir_instagram
get_post_meta
geodir_get_post_meta

]]>
https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24924 <![CDATA[Reply To: How do I get the value of a custom field programatically]]> https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24924 Thu, 18 Dec 2014 21:43:24 +0000 Simone hi,
you should use

geodir_get_post_meta($postid,'geodir_instagram',true);

first set your $postid, e.g. with



global $wp_query;

$postid = $wp_query->post->ID;
]]>
https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24926 <![CDATA[Reply To: How do I get the value of a custom field programatically]]> https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24926 Thu, 18 Dec 2014 21:55:51 +0000 nitefader Thanks Simone!

I just discovered this as well, please let me know if this is a bad approach==>

$post_details = geodir_get_post_info($entry[‘ID’]);
// print_r($post_details);
$replace=’**** ‘. $post_details->geodir_instagram . ‘ ***’;

Thanks this is resolved for me!

]]>
https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24929 <![CDATA[Reply To: How do I get the value of a custom field programatically]]> https://wpgeodirectory.com/support/topic/how-do-i-get-the-value-of-a-custom-field-programatically/#post-24929 Thu, 18 Dec 2014 22:00:22 +0000 Simone this could be another approach 🙂
glad you sorted out

]]>