Пример #1
0
function vntd_blog_post_content()
{
    global $post;
    $post_format = get_post_format($post->ID);
    if (!$post_format) {
        $post_format = 'standard';
    }
    $blog_head_class = '';
    if (has_post_thumbnail($post->ID) && $post_format != 'video') {
        $blog_head_class = ' inner-head t-shadow';
    }
    ?>
	
	<div <?php 
    post_class();
    ?>
>
		<!-- Post Header -->
		<div class="blog-head clearfix<?php 
    echo $blog_head_class;
    ?>
">
			<!-- Post Date -->
			<div class="blog-head-left t-center">
				<!-- Day -->
				<h1 class="uppercase bigger font-primary">
					<?php 
    the_time('d');
    ?>
				</h1>
				<!-- Month, Year -->
				<p class="uppercase font-primary">
					<?php 
    the_time('M Y');
    ?>
				</p>
			</div>
			<!-- End Post Date -->
			<!-- Post Header -->
			<a href="<?php 
    echo get_permalink($post->ID);
    ?>
" class="blog-head-right ex-link t-left">
				<!-- Header -->
				<h1 class="uppercase font-primary">
					<?php 
    echo get_the_title($post->ID);
    ?>
				</h1>
				<?php 
    if (get_post_meta($post->ID, 'page_subtitle', TRUE)) {
        echo '<p>' . get_post_meta($post->ID, 'page_subtitle', TRUE) . '</p>';
    }
    ?>
			</a>
			<!-- Post Header -->
		</div>
		<!-- Post Header -->
		
		<?php 
    if (has_post_thumbnail()) {
        vntd_post_media();
    }
    ?>
	

		<!-- Post Details -->
		<div class="details">
			<!-- Post Infos -->
			<div class="post-info">
				<!-- Post Item -->
				<a href="<?php 
    echo get_the_author_meta('user_url');
    ?>
" class="post-item">
					<i class="fa fa-user"></i>
					<?php 
    the_author();
    ?>
					
				</a>
				<!-- Post Item -->
				<span class="post-item">
					<i class="fa fa-tags"></i>
					<?php 
    the_category(', ');
    ?>
				</span>
				<!-- Post Item -->
				<a href="<?php 
    echo get_permalink($post->ID) . '#comments';
    ?>
" title="<?php 
    _e('View comments', 'veented');
    ?>
" class="post-item">
					<i class="fa fa-comments"></i>
					<?php 
    comments_number('0', '1', '%');
    echo ' ';
    _e('Comments', 'vntd_north');
    ?>
				</a>
			</div>
			<!-- End Post Infos -->
			<!-- Post Description -->
			<?php 
    if (!is_single()) {
        echo vntd_excerpt(240, true, 'post-text');
    }
    ?>
		
		</div>
		<!-- End Post Details -->
		
		<?php 
    if (is_single()) {
        the_content();
    }
    ?>
		
	</div>
		
	<?php 
}
function vntd_blog_post_content($page_layout = NULL, $blog_style = NULL, $grid_style = NULL, $masonry = NULL)
{
    global $post;
    $post_format = get_post_format($post->ID);
    if (!$post_format) {
        $post_format = 'standard';
    }
    $extra_classes = array();
    $excerpt_size = 50;
    if (is_null($grid_style)) {
        $grid_style = vntd_option('blog_grid_style');
    }
    if (is_null($blog_style)) {
        $blog_style = 'classic';
    }
    if ($blog_style == "grid" || $blog_style == "timeline") {
        //echo "yes";
        $extra_classes = array('item', 'vntd-grid-item');
        $excerpt_size = 20;
        if (vntd_option('blog_grid_style') == 'thumb_bg') {
            if (!has_post_thumbnail()) {
                return null;
            }
            $excerpt_size = 18;
        }
    } elseif ($blog_style == "minimal") {
        $excerpt_size = 30;
    }
    $post_media_class = 'post-no-media';
    if (has_post_thumbnail()) {
        $post_media_class = 'post-has-media';
    }
    array_push($extra_classes, $post_media_class);
    if (!$masonry) {
        $masonry = vntd_option('blog_masonry');
        if ($masonry == true) {
            $masonry = 'yes';
        }
    }
    ?>
	
	<div <?php 
    post_class($extra_classes);
    ?>
>
	
		<div class="blog-post-wrap">
	
		<?php 
    if ($blog_style != "classic") {
        vntd_post_meta_extra();
    }
    if (has_post_thumbnail()) {
        vntd_post_media($blog_style, $page_layout, $grid_style, $masonry);
    }
    ?>
	
		
		<div class="blog-post-inner">
			<div class="post-inner">
			<?php 
    if ($blog_style == "grid" && vntd_option('blog_grid_style') == "thumb_bg") {
        vntd_post_meta_extra();
    }
    ?>
			<!-- Post Header -->
			<div class="blog-head">
				<h2 class="blog-post-title">
					<a href="<?php 
    echo get_permalink($post->ID);
    ?>
">
					<?php 
    echo get_the_title($post->ID);
    ?>
					</a>
				</h2>
			</div>
			<!-- Post Header -->
			
			<?php 
    vntd_post_meta();
    ?>
	
			<!-- Post Details -->
			<div class="details">
				<?php 
    if (!is_single()) {
        echo vntd_excerpt($excerpt_size, true);
    }
    ?>
		
			</div>
			<!-- End Post Details -->
			
			</div>
		</div>
		<?php 
    if (is_single()) {
        the_content();
    }
    ?>
		
		</div>
		
	</div>
		
	<?php 
}