<?php $attached_images = get_attached_media( 'image' ); ?>
<div><?php echo count($attached_images); ?> прикрепленных изображений</div>
function count_img_in_post ($content) {
preg_match_all('/<img(.*?)src=("|\'|)(.*?)("|\'| )(.*?)>/s', $content, $images);
if(has_post_thumbnail()) {
return count($images[0]) + 1;
}
return count($images[0]);
}
<?php $content = get_the_content(); ?>
<div><?php echo count_img_in_post($content); ?> прикрепленных изображений</div>
$terms = get_terms( array(
'taxonomy' => 'pa_proizvoditel'
) );
foreach( $terms as $term ) {
$terms_ids[] = $term -> term_id;
}
$args = array(
'posts_per_page' => -1,
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'pa_proizvoditel',
'field' => 'term_id',
'terms' => $terms_ids,
),
),
);
$custom_query = new WP_Query( $args );
if ( $custom_query->have_posts() ) :
while ( $custom_query->have_posts() ) :
$custom_query->the_post();
the_title();
echo get_field("name", $terms);
endwhile;
endif;
wp_reset_postdata();
$args = array(
'date_query' => array(
array(
'after' => 'January 1st, 2019',
'before' => 'January 31st, 2021',
'inclusive' => true,
),
),
);
$query = new WP_Query( $args );
$args = array(
'status' => 'approve',
);
$comments = get_comments( $args );
foreach ( $comments as $comment ) :
echo $comment->comment_author . '<br />' . $comment->comment_content;
endforeach;
$keyg = get_post_field( 'банкс', get_the_ID() );
<user_id>
и <num_of_posts>
меняешь на своиhttps://www.instagram.com/graphql/query/?query_id=17888483320059182&variables=%7B%22id%22%3A%22<user_id>%22%2C%22first%22%3A<num_of_posts>%7D
<?php if ( in_category( array('news', 'articles') )) { ?>
<h4><?php echo get_the_author() ?></h4>
<?php } ?>
<body <?php body_class(); ?>>
и посмотрите, какой класс шаблона будет там.