Hello, this is my first post, I’m sorry if I do something wrong
I basically want to
1) show fields of posts in a table (see below)
2) Just to know opinion if it would be to difficult to make this a new listing search template…so when user in search select category HOTEL, all Hotels appear in this table with their fields values, like this:
NAME ADRRESS PHONE PRICE ETC
hotel 1 adress 1 2839839 $450
hotel 2 adress 2 2823329 $50
so 1) I have it the way I want but I don’t know how to retrieve GD FIELDS, I searched other forum posts and all I got is the code below.
for regular wp fields, like the_title(), it works!
Thanks for any help! I would be happy achieving 1) even happier to take it to next level and integrate with the search
<table>
<thead>
<tr>
<th>Título</th>
<th>Address</th>
<th>Phone</th>
</tr>
</thead>
<tbody>
<?php
//DEFINE GD FIELDS
global $wp_query;
$postid = $wp_query->post->ID; // retrieve the ID
$address= geodir_get_post_meta($postid,'address',true);
//DEFINE POST ARGS FOR LOOP
global $post;
$args = array(
'numberposts' => -1,
'orderby' => 'DESC',
'post_type' => 'gd_place',
);
$myposts = get_posts( $args );
//LOOP
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<tr>
<td><?php the_title(); ?></td>
<td><?php echo $address; ?></td>
</tr>
<?php endforeach;
wp_reset_postdata();?>
</tbody>
</table>