<?php
function count_term_use () {
$term_id = \Bricks\Query::get_loop_object_id();
$my_posts = get_posts(array(
'post_type' => 'product', //post type
'numberposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'product_cat', //taxonomy name
'field' => 'id', //field to get
'terms' => $term_id, //term id
)
)
));
return $count = count($my_posts);
}
function type_post(){
if(is_front_page() || !is_singular()){
return "true";
}
}
?>