$column_count++; $column_class = 'span3'; $column_class .= $column_count == 4 || $column_count == 3 && $articles['layout'] == 'left_sidebar' ? ' last' : ''; $sid = get_the_id(); $link = get_permalink($sid); echo '<div class="' . $column_class . '">'; echo '<div class="entry has_preview">'; if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $thumb = miss_wp_image($thumb[0], 518, 338); echo '<div class="post-thumbnail"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>'; } echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>'; echo '<div class="date">' . get_the_time('l, M j Y') . '</div>'; echo '<p>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_articles_excerpt', $articles['excerpt']['content']), apply_filters('miss_home_articles_excerpt', THEME_ELLIPSIS)) . '</p>'; if ($articles["readmore"]["enable"] == true) { $readmore_caption = $articles['readmore']['label'] ? $articles['readmore']['label'] : __('Read More', MISS_TEXTDOMAIN); echo '<p class="read_more_block"><a class="post_more_link" href="' . esc_url($link) . '">' . $readmore_caption . '</a></p>'; //echo miss_read_more( $title = $articles['readmore']['label'], $link = get_permalink() ); } echo '</div>'; echo '</div>'; } if ($articles['layout'] == 'right_sidebar') { echo '<div class="span3 last">'; echo miss_render_subblock($opt, $articles['subblock'], 'right'); echo '</div>'; } echo '</div>'; echo '<div class="clearfix"></div>'; }
/** * Rendering News Sections * @since 1.5 */ function miss_region_news($news = array()) { $out = ''; if (isset($news['enable'][0]) && $news['enable'][0] == "true") { $opt['custom'] = $news['custom']; $out .= '<!-- Begin News -->'; $out .= '<div class="divider_dotted"></div>'; $out .= '<div id="latest-news">'; $out .= '<div class="inner">'; $out .= '<h2 class="display-inline-block">' . $news['caption'] . '</h2>'; $out .= '<div class="news-controls">'; $out .= '<li class="news-readmore"><a href="' . $news['url'] . '">' . $news['more'] . '</a></li>'; $out .= '</div>'; $args = array('showposts' => $news['limit'], 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'news'); $out .= '<div id="news-list">'; $query = new WP_Query(); $query->query($args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); // $postslist = get_posts( $args ); // foreach ($postslist as $post) { // setup_postdata($post); $out .= '<div class="column6">'; $out .= '<div class="news-inner">'; if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $thumb = miss_wp_image($thumb[0], 207, 207); $out .= '<div class="news_thumb post-thumbnail round">'; $out .= '<div class="post-thumbnail round"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>'; $out .= '<div class="shadow small"></div>'; $out .= '</div>'; } // $out .= '<div class="date ' . $news['date_style'] .'"><span class="span">' . get_the_time('M') . '</span><br /><span class="day">' . get_the_time('j') . '</span></div>'; $out .= '<div class="entry"><h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_news_excerpt', $news['excerpt']['content']), apply_filters('miss_home_news_excerpt', THEME_ELLIPSIS)) . '</div>'; $out .= '</div>'; $out .= '</div>'; } } $out .= '</ul>'; $out .= '</div>'; if ($news['layout'] == 'split') { $out .= '<div class="inner ' . $news['layout'] . ' pull-right">'; $out .= miss_render_subblock($opt, $news['subblock']); $out .= '</div>'; } $out .= '</div>'; $out .= '<div class="clearfix"></div>'; } return $out; }
$query->the_post(); $sid = get_the_id(); $link = get_permalink($sid); $column_count++; $column_class = 'span3'; $column_class .= $column_count == 4 || $column_count == 3 && $spotlight['layout'] == 'left_sidebar' ? ' last' : ''; echo '<div class="' . $column_class . '">'; echo '<div class="entry has_preview">'; if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $thumb = miss_wp_image($thumb[0], 518, 338); echo '<div class="post-thumbnail"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>'; } echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>'; echo '<div class="date">' . get_the_time('l, M j Y') . '</div>'; echo '<p>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', $spotlight['excerpt']['content']), apply_filters('miss_home_spotlight_excerpt', THEME_ELLIPSIS)) . '</p>'; if ($spotlight["readmore"]["enable"] == true) { $readmore_caption = $spotlight['readmore']['label'] ? $spotlight['readmore']['label'] : __('Read More', MISS_TEXTDOMAIN); echo '<p class="read_more_block"><a class="post_more_link" href="' . esc_url($link) . '">' . $readmore_caption . '</a></p>'; } echo '</div>'; echo '</div>'; } if ($spotlight['layout'] == 'right_sidebar') { echo '<div class="span3 last">'; echo miss_render_subblock($opt, $spotlight['subblock']); echo '</div>'; } echo '</div>'; echo '<div class="clearfix"></div>'; }