GeoDirectory SupportHow to get Address value – GeoDirectory Support https://wpgeodirectory.com/support/topic/how-to-get-address-value/feed Mon, 06 Apr 2026 17:03:28 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35631 <![CDATA[How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35631 Mon, 30 Mar 2015 22:32:20 +0000 sleepydada Hi,

I’m trying to create a search form that has multiple fields, including one for searching by location. I’m trying to figure out how to get the address value from each listing, but nothing seems to be working. This is what I have:

<?php echo geodir_post_custom_fields($post->id, ‘address’, true); ?>

which simply displays:

Array Array Array Array Array Array Array Array Array Array

I’d appreciate your help.

Thanks.

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35634 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35634 Mon, 30 Mar 2015 23:04:25 +0000 Simone Hello the correct is


<?php echo geodir_get_post_meta($post->id,'post_address',true);  ?>
]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35635 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35635 Mon, 30 Mar 2015 23:07:52 +0000 sleepydada Thanks so much for your quick response! But it’s still showing “Array Array …”

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35637 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35637 Mon, 30 Mar 2015 23:09:10 +0000 sleepydada No I mean, now the page does not display anything

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35638 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35638 Mon, 30 Mar 2015 23:09:51 +0000 sleepydada This is the whole code:


<?php
/* Template Name: Search Test */
?>
<?php get_header();?>

      <?php
        global $wp_query;
        query_posts(array(
            'post_type' => 'gd_place'
        ));

        while(have_posts()) : the_post(); ?>
            

<?php echo geodir_get_post_meta($post->id,'post_address',true);  ?>
            
         <?php
        endwhile;
        wp_reset_query();
        ?>

<?php get_footer();
]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35639 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35639 Mon, 30 Mar 2015 23:10:50 +0000 Simone try to set the ID in a different variable such as

$postid = $wp_query->post->ID; // retrieve the ID

and then use it like this


$address= geodir_get_post_meta($postid,'post_address',true); 
echo $address;
]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35641 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35641 Mon, 30 Mar 2015 23:12:50 +0000 sleepydada That works! Thank you!

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35642 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35642 Mon, 30 Mar 2015 23:15:08 +0000 Simone glad it works, you’re welcome

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35653 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35653 Tue, 31 Mar 2015 00:16:32 +0000 sleepydada Now… How could I query this??

]]>
https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35654 <![CDATA[Reply To: How to get Address value]]> https://wpgeodirectory.com/support/topic/how-to-get-address-value/#post-35654 Tue, 31 Mar 2015 00:17:38 +0000 Simone ..what you mean?

]]>