1. Create a new folder “acadp_templates” inside your WordPress theme’s directory
2. Copy the “listings” folder from {root}/wp-content/plugins/advanced-classifieds-and-directory-pro/public/partials/ to the folder created in step 1.
3. Open “acadp-public-listings-grid-display.php”
4. Add the following code somewhere inside the loop,
<?php
$category = wp_get_object_terms( $post->ID, 'acadp_categories' );
// get custom fields
$args = array(
'post_type' => 'acadp_fields',
'tax_query' => array(
array(
'taxonomy' => 'acadp_categories',
'field' => 'term_id',
'terms' => $category[0]->term_id,
),
),
'meta_key' => 'order',
'order_by' => 'meta_value_num',
'order' => 'ASC',
);
$fields = get_posts( $args );
?>
<?php if( count( $fields ) ) : ?>
<ul class="list-group acadp-margin-bottom">
<?php foreach( $fields as $field ) : ?>
<?php if( $value = get_post_meta( $post->ID, $field->ID, true ) ) : ?>
<li class="list-group-item acadp-no-margin-left">
<span class="text-primary"><?php echo $field->post_title; ?></span> :
<span class="text-muted"><?php echo $value; ?></span>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
5. Save the changes. Hope, this solved your issue.
NOTE: I haven’t tested this code yet. Kindly let me know if this works.