Пример #1
0
  
        </div><!-- .entry-content -->
    
	<?php 
}
?>
        
	<footer class="entry-meta">
		<?php 
if ('post' == get_post_type()) {
    // Hide category and tag text for pages on Search
    ?>
			<?php 
    /* translators: used between list items, there is a space after the comma */
    $categories_list = get_the_category_list(__(', ', 'delaware-theme'));
    if ($categories_list && lambda_categorized_blog()) {
        ?>
			<span class="cat-links">
				<i class="icon-folder-open"></i><?php 
        printf(__('Posted in&#58; %1$s', 'delaware-theme'), $categories_list);
        ?>
			</span>
			<?php 
    }
    // End if categories
    ?>

			<?php 
    /* translators: used between list items, there is a space after the comma */
    $tags_list = get_the_tag_list('', __(', ', 'delaware-theme'));
    if ($tags_list) {
    function render_lambda_blog_grid($metadata, $homeblog = false)
    {
        global $wp_query;
        $theme_options = get_option('option_tree');
        #-----------------------------------------------------------------
        # assign home settings
        #-----------------------------------------------------------------
        $numberpost = isset($metadata['blog_length']) ? $metadata['blog_length'] : '-1';
        $blogcats = isset($metadata['only_category']) && is_array($metadata['only_category']) ? implode(",", $metadata['only_category']) : '';
        $post_not_in = isset($metadata['post_not_in']) && is_array($metadata['post_not_in']) ? $metadata['post_not_in'] : array();
        $post_not_in = array_push_after($post_not_in, get_option('sticky_posts'), 1);
        $mediaheight = !empty($metadata['blog_media_height']) ? $metadata['blog_media_height'] : 300;
        $mediawidth = !empty($metadata['blog_grid']) ? $metadata['blog_grid'] : 'span12';
        #-----------------------------------------------------------------
        # prepare blog query
        #-----------------------------------------------------------------
        $z = 1;
        $blogcount = 0;
        $args = array('posts_per_page' => $numberpost, 'post__not_in' => $post_not_in, 'cat' => $blogcats, 'paged' => get_query_var('paged') ? get_query_var('paged') : 1);
        #-----------------------------------------------------------------
        # execute query
        #-----------------------------------------------------------------
        query_posts($args);
        #-----------------------------------------------------------------
        # number of posts, we need this counter to close the row
        # if there are not enough items to fill the current grid
        #-----------------------------------------------------------------
        $number_of_posts = have_posts() ? sizeof($wp_query->posts) : 0;
        #-----------------------------------------------------------------
        # run through posts
        #-----------------------------------------------------------------
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                global $more, $post;
                $more = isset($metadata['activate_blog_excerpt']) && $metadata['activate_blog_excerpt'] == 'on' ? 1 : 0;
                $bloggrid = isset($metadata['blog_grid']) ? $metadata['blog_grid'] : 'span4';
                $gridcount = array('span12' => '1', 'span4' => '3', 'span6' => '2', 'span3' => '4');
                ?>
 
            
            
            <?php 
                echo $z == 1 ? '<div class="row-fluid">' : '';
                ?>
                        
            <article <?php 
                post_class($bloggrid);
                ?>
 id="post-<?php 
                the_ID();
                ?>
">
                
                <div class="post-format span1 <?php 
                echo is_single() ? 'hidden' : '';
                ?>
">
		<?php 
                lambda_postformat_icon();
                ?>
        <?php 
                lambda_posted_on('compact');
                ?>
				</div>
                
             <div id="resume">  
                <header class="entry-header">
                   
                    <?php 
                if (isset($metadata['activate_blog_images']) && $metadata['activate_blog_images'] == 'on') {
                    ?>
                
                        <?php 
                    lambda_postformat_media(get_post_format(), true, $mediaheight, $mediawidth);
                    ?>
                    
                    <?php 
                }
                ?>
                    
                    <?php 
                if (isset($metadata['activate_blog_images']) && $metadata['activate_blog_images'] == 'on') {
                    ?>
                    
                        <?php 
                    if (has_post_thumbnail() && !post_password_required()) {
                        ?>
                
                            <div class="entry-thumbnail clearfix">
                            
                                <?php 
                        lambda_postformat_media('standard', true, $mediaheight, $mediawidth);
                        ?>
                                
                            </div><!-- entry-thumbnail -->
                        
                        <?php 
                    }
                    // post_password_required()
                    ?>
                    
                    <?php 
                }
                ?>
                    
                    <?php 
                $postlink = get_post_format() == 'link' ? esc_url(get_post_format_link_content()) : get_permalink();
                ?>
                    
                    <h4>
                        <a href="<?php 
                echo $postlink;
                ?>
" title="<?php 
                echo esc_attr(sprintf(__('Permalink to %s', 'delaware-theme'), the_title_attribute('echo=0')));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a>
                    </h4>
                    
                </header>
                
                <div class="entry-content clearfix">
                    
                    <?php 
                /* only display continue reading on special post formats */
                if (get_post_format() != 'link' && get_post_format() != 'quote') {
                    if (isset($metadata['activate_blog_excerpt']) && $metadata['activate_blog_excerpt'] == 'on') {
                        $excerptlength = isset($metadata['blog_excerpt_length']) ? $metadata['blog_excerpt_length'] : $theme_options['excerpt_blog_length'];
                        echo excerpt_by_id($post->ID, $excerptlength, '', lambda_continue_reading_link(), $homeblog);
                    } else {
                        the_content(__('Lire la suite', 'delaware-theme') . '<i class="icon-angle-right"></i>');
                    }
                }
                /* show quote content */
                if (get_post_format() == 'quote') {
                    post_format_quote_content();
                }
                /* show chat content */
                if (get_post_format() == 'chat') {
                    post_format_chat_content();
                }
                ?>
                    
                </div>    
        		
                <?php 
                if (isset($metadata['activate_blog_meta']) && $metadata['activate_blog_meta'] == 'on') {
                    ?>
                
                <footer class="entry-meta">
                
					<?php 
                    if ('post' == get_post_type()) {
                        // Hide category and tag text for pages on Search
                        ?>
                        <?php 
                        /* translators: used between list items, there is a space after the comma */
                        $categories_list = get_the_category_list(__(', ', 'delaware-theme'));
                        if ($categories_list && lambda_categorized_blog()) {
                            ?>
                       
                        <?php 
                        }
                        // End if categories
                        ?>
            
                        <?php 
                        /* translators: used between list items, there is a space after the comma */
                        $tags_list = get_the_tag_list('', __(', ', 'delaware-theme'));
                        if ($tags_list) {
                            ?>
                        <span class="tags-links">
                            <i class="icon-tags"></i>
                        </span>
                        <?php 
                        }
                        // End if $tags_list
                        ?>
                    <?php 
                    }
                    // End if 'post' == get_post_type()
                    ?>
            
                    <?php 
                    if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
                        ?>
                    <span class="comments-link"><i class="icon-comment"></i><?php 
                        comments_popup_link(__('Leave a comment', 'delaware-theme'), __('1 Comment', 'delaware-theme'), __('% Comments', 'delaware-theme'));
                        ?>
</span>
                    <?php 
                    }
                    ?>
                        
            	</footer><!-- .entry-meta -->                
                
                <?php 
                }
                ?>
                </div>
            </article>
            
            <?php 
                /* increase blog item counter */
                $blogcount++;
                /* close row after we have filled up the row with items */
                echo $z == $gridcount[$bloggrid] || $blogcount == $number_of_posts ? '</div>' : '';
                /* reset our counter for next row */
                $z == $gridcount[$bloggrid] ? $z = 1 : $z++;
                /* loop is finished */
            }
        }
        /* show or hide pagination */
        if (!empty($metadata['activate_blog_pagination']) && $metadata['activate_blog_pagination'] == 'on') {
            lambda_content_nav('nav-below');
        }
        #-----------------------------------------------------------------
        # reset query
        #-----------------------------------------------------------------
        wp_reset_query();
    }