Custom fields separate commas
-
I use this your code (https://www.ads-software.com/support/topic/custom-field-output-in-grid-display-listings/)
// 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; ?>
How to separate commas custom fields ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom fields separate commas’ is closed to new replies.