Выделяем заголовок VIP объявления в Classipress
Выделяем ярким маркером название VIP объявления.
Откройте файл style.css и дополните его следующим кодом:
1 2 3 4 5 6 7 8 |
.featured-description-title-link { background-color: #fbfe23; line-height: 19px; color: #08729c; margin-top: -1px; padding: 2px 3px 0; display: inline-block; } |
Затем в файле content-ad_listing.php заменим строку:
1 |
<h3><a href="<?php the_permalink(); ?>"><?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ) . '...'; else the_title(); ?></a></h3> |
на
1 2 |
<h3><a <?php if( is_sticky($post_ID) == true) echo 'class="featured-description-title-link"'; ?> href="<?php the_permalink(); ?>"> <?php if ( mb_strlen( get_the_title() ) >= 75 ) echo mb_substr( get_the_title(), 0, 75 ) . '...'; else the_title(); ?></a></h3> |
classipress/content-ad_listing.php выводим маленькую иконку
1 2 3 4 5 6 7 |
<div id="custom-stats"> <?php if( get_post_meta( $post->ID, 'cp_color', true ) == '1' ) echo '<span class="custom-stats"><img class="custom-stats-icon" src= "' . get_stylesheet_directory_uri() . '/images/color_icon.png" title="Выделенное объявление"/></span>'; ?> <?php if(is_sticky($post_ID) == true) echo '<span class="custom-stats"><img class="custom-stats-icon" src= "' . get_stylesheet_directory_uri() . '/images/vip_icon.png" title="VIP-объявление"/></span>'; ?> <?php if( get_post_meta( $post->ID, 'cp_up', true ) == '1' ) echo '<span class="custom-stats"><img class="custom-stats-icon" src= "' . get_stylesheet_directory_uri() . '/images/up_icon.png" title="Объявление было поднято в поиске"/></span>'; ?> <?php if( get_post_meta( $post->ID, 'cp_premium', true ) == '1' ) if( (date('U')-get_the_time('U')) <= 7*24*60*60) echo '<span class="custom-stats"><img class="custom-stats-icon" src= "' . get_stylesheet_directory_uri() . '/images/premium_icon.png" title="Премиум-объявление"/></span>'; ?> </div> |
