<?php
$temp = $wp_query; $wp_query= null;
$wp_query = new WP_Query(); $wp_query->query('category_name=for_heating&showposts=-1' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-12 one_card <?php $posttags = get_the_tags();
if( $posttags ){
foreach( $posttags as $tag ){
echo $tag->slug. ' ';
}
} ?>">
<div class="card_item" id="spoiler1">
<div class="content-item">
<div class="title_svg d-flex justify-content-between">
<h4 class="h4_cards">
<?php the_title() ?>
</h4>
<div class="svg_card">
<?php function wpp_change_svg_img_color( $url, $color ) {
$content = file_get_contents( $url );
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;
$doc->loadXML( $content ) or die( 'Failed to load SVG ' . $url );
$paths = $doc->getElementsByTagName( "path" );
foreach ( $paths as $path ) {
$path->setAttribute( 'fill', $color );
$path->setAttribute( 'style', 'fill:' . $color );
$content = $doc->saveXML( $doc );
}
return $content;
}
$url = the_post_thumbnail_url( 'full' ); // url миниатюры
$color = '#000000'; #нужный вам цвет
printf( '<img src="%s" alt="">', wpp_change_svg_img_color( $url, $color) );
?>
</div>
</div>
<p class="p6">
<?php the_excerpt(); ?>
</p>
</div>
</div>
</div>
<?php endwhile; ?>