$posts = array(
95 => array( 'count' => 2, 'ID' => 77 ),
65 => array( 'count' => 1, 'ID' => 144 ),
81 => array( 'count' => 1, 'ID' => 106 ),
84 => array( 'count' => 1, 'ID' => 103 ),
0 => array( 'count' => 0, 'ID' => 327 ),
1 => array( 'count' => 0, 'ID' => 326 ),
2 => array( 'count' => 0, 'ID' => 325 )
);
$ids = array();
foreach ($posts as $post) {
$ids[] = $post['ID'];
}
<?php $category = get_the_category(); ?>
<a class="post-category-color-text <?php echo $category[0]->slug; ?>" style="background:#36c942" href="#">
<?php echo $category[0]->cat_name; ?>
</a>
/* Пример */
/* Для slug = animals */
.animals{
background: #eee;
}
/* Для slug = birds */
.birds{
background: #ccc;
}
<div class="aaa" style="background-image: url(<?php echo get_the_post_thumbnail_url() ?>)">
<ul class="offer-page-list <?php echo (!get_field('offer_disabled')) ? 'offer-terms-list_disabled' : '' ?>">
<?php if(!get_field('offer_disabled')) : ?>
<ul class="offer-page-list">
....
</ul>
<?php endif; ?>
add_action( 'wp_enqueue_scripts', 'custom_scripts' );
function custom_scripts(){
if( is_page( $id ) ) { // тут ID, slug или заголовок страницы
wp_enqueue_style( 'custom', get_template_directory_uri() . '/css/mysite.css');
}
}