$terms = get_queried_object();
$photodik = get_field('block_foto_posle_abzaca_2','category_' . $terms->term_id);
<?php if ( $photodik) { ?>
<?php
foreach($photodik as $photo):?>
<div class="col-1-1 col-md-1-2">
<p style="text-align: center;"><a href="<?= $photo['foto']; ?>"><img alt="" src="<?= $photo['foto']; ?>" style="max-width: 100%;border-radius: 5px;" title=""></a></p>
</div>
<?php endforeach; ?>
<?php } ?>
public static function get_taxonomy_hierarchy( $taxonomy, $parent = 0 ) {
$taxonomy = is_array( $taxonomy ) ? array_shift( $taxonomy ) : $taxonomy;
$terms = get_terms( $taxonomy, array( 'parent' => $parent ,'hide_empty'=>0) );
$children = array();
foreach ( $terms as $term ){
$term->children = self::get_taxonomy_hierarchy( $taxonomy, $term->term_id );
$children[ $term->term_id ] = $term;
}
return $children;
}
public function get_taxonomy_hierarchy_multiple( $taxonomies, $parent = 0 ) {
if ( ! is_array( $taxonomies ) ) {
$taxonomies = array( $taxonomies );
}
$results = array();
foreach( $taxonomies as $taxonomy ){
$terms = get_taxonomy_hierarchy( $taxonomy, $parent );
if ( $terms ) {
$results[ $taxonomy ] = $terms;
}
}
return $results;
}
wp_add_inline_script('boost-script', 'const bost_type....');
<?php $loop = new WP_Query( array(
'post_type' => 'post','
posts_per_page' => -1,
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'name_field',
'value' => '1',
)
)
));
while ( $loop->have_posts() ): $loop->the_post(); ?>
// echo
<?php endwhile; wp_reset_postdata(); ?>