function block($instance)
    {
        extract($instance);
        $title = $instance['title'];
        $post_type = 'all';
        $categories = $instance['categories'];
        $post_types = get_post_types();
        unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']);
        if ($post_type == 'all') {
            $post_type_array = $post_types;
        } else {
            $post_type_array = $post_type;
        }
        ?>
			<?php 
        if ($title == "") {
        } else {
            ?>
			<h2 class="widget"><a href="<?php 
            echo get_category_link($categories);
            ?>
"><?php 
            echo esc_attr($title);
            ?>
</a></h2>
			<?php 
        }
        ?>
            </div></div></div>
            
            
            <div class="clearfix"></div>
            <div class="maso <?php 
        if ($offset == 1) {
            echo 'nav-offset';
        } else {
        }
        ?>
 <?php 
        if ($right_lay == 1) {
            echo 'right-layout';
        } else {
        }
        ?>
">
            
                <ul class="maso-inn" >
                
                
                    <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso1 item">
                                
                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('horiz', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_cat();
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>
                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                    



                    <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 1, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso2 item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('horiz', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_cat();
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>

                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                    
                    
                
                    <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 2, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso3 masosmall item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('small', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>

                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                    
                    
                    <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 3, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso4 masosmall item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('small', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>

                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
    
                    
                    
                     <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 4, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso5 masosmall item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('small', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>

                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                    



                     <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 5, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso6 masosmall item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('vert', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>

                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                    
                    
                    
                    
                     <?php 
        $recent_posts = new WP_Query(array('showposts' => 1, 'cat' => $categories, 'offset' => 6, 'ignore_sticky_posts' => 1));
        while ($recent_posts->have_posts()) {
            $recent_posts->the_post();
            ?>
        
                        <li class="maso7 masosmall item">


                                <div class="imgwrap">
                            
                                    <?php 
            echo tmnf_ratings();
            ?>
                                
                                     <a class="imglink" href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" >
                                     
                                        <?php 
            the_post_thumbnail('vert', array('class' => "tranz grayscale grayscale-fade"));
            ?>
                                        
                                     </a>
                                     
                                </div>
                                
                                <div class="masoinside tranz"><span class="bg tranz"></span>
                                
									<?php 
            tmnf_meta_date();
            tmnf_meta_counter();
            ?>
                                    
                                    <div class="clearfix"></div>
                                        
                                    <h2><a href="<?php 
            tmnf_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            echo short_title('...', 16);
            ?>
</a></h2>
                                
                                 </div>
                                
                                    
                        </li>
        
                    <?php 
        }
        ?>
                 
                
                
                </ul>
            
            </div>
            <div class="container builder woocommerce"><div>   <div> 
            <?php 
        wp_reset_query();
        ?>
			<?php 
    }
Example #2
0
                                    
                            <h2><a href="<?php 
tmnf_permalink();
?>
" title="<?php 
the_title();
?>
"><?php 
echo short_title('...', 16);
?>
</a></h2>
                         
                         	
                    
							<?php 
tmnf_meta_cat();
tmnf_meta_date();
tmnf_meta_counter();
?>
                            
                            <div class="clearfix"></div>
                            
                            <p class="teaser tranz"><?php 
echo themnific_excerpt(get_the_excerpt(), '160');
?>
...</p>
                    
                     	</div>
                     
                     </div>