?> <?php $id = $day_news->ID; ?> <a href="<?php echo get_permalink($id); ?> "> <div class="col-xs-12 day-article"> <div class="img-left-cat"><?php echo get_the_post_thumbnail($id, 'thumbnail', 'class=img-rounded'); ?> </div> <div class="text-right-cat"> <span class="time-day-news"><?php echo date_news($day_news->post_date, 'number_mon'); ?> </span> <div class="title-day-article"><?php echo $day_news->post_title; ?> </div> <p><?php echo wp_trim_words($day_news->post_content, 10); ?> </p> <hr> </div> </div> </a>
<?php echo get_the_post_thumbnail($item->ID, 'thumbnail', 'class=media-object'); ?> </a> </div> <div class="media-body"> <a href="<?php echo get_permalink($item->ID); ?> "><h4 class="media-heading"><?php echo $item->post_title; ?> </h4></a> <span class="media-time-news"><?php echo date_news($item->post_date, 'numeric'); ?> </span> <p class="media-text"><?php echo wp_trim_words($item->post_content, 25); ?> </p> <a href="<?php echo get_permalink($item->ID); ?> " class="media-moore"><?php echo lang_text('Подробнее', $lang); ?> </a> </div> </div>
<div id="content" class="site-content news-single" role="main"> <?php // Start the loop. while (have_posts()) { the_post(); ?> <div class="title-single-news"><?php the_title(); ?> </div> <div class="col-xs-12 time-single-news"><span><?php echo the_time('G:i'); ?> </span> <?php echo date_news(get_the_date('Y-m-d G:i'), 'text_mon_news'); ?> </div> <div class="img-single-news-wrapp"> <div class="img-single-news" style="background: url(<?php echo wp_get_attachment_url(get_post_thumbnail_id($singleID)); ?> ) no-repeat; background-size: 100% auto; "></div> <?php $description_img_single = get_metadata('post', $singleID, 'description_news_img_single', 1); if (!empty($description_img_single)) { ?> <p><?php echo $description_img_single; ?>
public function widget($args, $instance) { $title = apply_filters('widget_title', $instance['title']); $args['before_title'] = '<span class="widget-title title-cat-header widget-news">'; $args['after_widget'] = '</div>'; $args['after_title'] = '</span>'; echo $args['before_widget']; if (!empty($title)) { echo $args['before_title'] . $title . $args['after_title']; } ?> <?php $news_posts = new WP_Query(); $news_posts = $news_posts->query(array('cat' => '2', 'showposts' => '10', 'post_per_page' => '10', 'order' => 'post_date')); ?> <div class="widget-front box-content news-widget-single"> <ul class="list-article"> <?php foreach ($news_posts as $article) { $id = $article->ID; ?> <li class="list-article-item"> <a href="<?php echo get_permalink($id); ?> "> <div class="time-news-widget col-xs-2"><?php echo date_news($article->post_date, 'time_news'); ?> </div> <div class="col-xs-10 title-article-news-widget"><?php echo $article->post_title; ?> </div> </a> </li> <?php } ?> </ul> <div class="more-news-day"> <a href="http://blacksea.tv/news/" class="more-news-link">Больше новостей</a> </div> </div> <?php wp_reset_postdata(); wp_reset_query(); echo $args['after_widget']; }