How can marge these loop code?

Question

I just need an idea where to put this code:

$term_featured_image_id = get_term_meta( $custom_term->ID, 'wp_travel_trip_type_image_id', true );
    $image_url = wp_get_attachment_url( $term_featured_image_id );

In This code:

<?php
$post_type = 'itineraries';
$custom_tax = 'travel_locations';
$custom_args = array(
'parent' => 0
);
$custom_terms = get_terms($custom_tax, $custom_args);
                    foreach($custom_terms as $custom_term) {
                        $term_link = get_term_link( $custom_term  );
                        wp_reset_query();
                        $args = array('post_type' => 'itineraries',
                                      'tax_query' => array(
                                          array(                                                  
                                              'taxonomy' => 'travel_locations',
                                              'field' => 'slug',
                                              'terms' => $custom_term->slug,                                                  

                                              ),
                                          ),
                                     ); ?>
                    <?php 
                        $loop = new WP_Query($args);
                        if($loop->have_posts()) { ?>
<?php
while($loop->have_posts()) : $loop->the_post(); ?>
//some content here
<?php
endwhile;?>
<?php } }?>
0
, Karan Kcoresys 1 year 0 Answers 66 views 0

Leave an answer