Example #1
0
    do_action('dynamowp_before_loop');
    ?>
		
		<?php 
    while (have_posts()) {
        the_post();
        ?>
			<?php 
        get_template_part('content', get_post_format());
        ?>
		<?php 
    }
    ?>
		
		<?php 
    dp_content_nav();
    ?>
		
		<?php 
    do_action('dynamowp_after_loop');
    ?>
		
	<?php 
} else {
    ?>
		<h1 class="page-title">
			<?php 
    _e('Nothing Found', DPTPLNAME);
    ?>
		</h1>
	
$newsquery = new WP_Query($args);
if (have_posts()) {
    ?>
	<section id="dp-mainbody">
    <?php 
    while ($newsquery->have_posts()) {
        $newsquery->the_post();
        ?>
	<?php 
        get_template_part('article-blog-large');
        ?>
    <?php 
    }
    ?>
    <?php 
    dp_content_nav($newsquery->max_num_pages, $range = 2);
    ?>
	<?php 
    wp_reset_query();
    ?>
    </section>
    <?php 
} else {
    ?>
	<section id="dp-mainbody">
		<article id="post-0" class="post no-results not-found">
			<header class="entry-header">
				<h1 class="entry-title"><?php 
    __('Nothing Found', DPTPLNAME);
    ?>
</h1>
        ?>
    
</script> 
   <?php 
    }
}
?>
    
   
			
		</div>
        <div class="clearboth"></div>
        <div class="space20"></div>
        <div class="centered-block-outer"><div class="centered-block-middle"><div class="centered-block-inner">
       	<?php 
dp_content_nav($gallery->max_num_pages, $range = 2);
?>
        </div></div></div>

    
       	
        <div class="clearboth"></div><div class="space30"></div>
        <?php 
include 'layouts/content.portfolio.footer.php';
?>
        <div class="space40"></div>
        
<?php 
dp_load('after-nosidebar', null, array('sidebar' => false));
dp_load('footer');
// EOF
/**
 *
 * Function to generate tblog grid layout
 *
 **/
function dp_print_blog_grid_layout($perpage, $column, $categories, $show_filter)
{
    global $dynamo_tpl, $post, $more;
    if ($perpage == '') {
        $perpage = get_option('posts_per_page');
    }
    if ($column == '') {
        $column = '4';
    }
    switch ($column) {
        case "2":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-two";
            break;
        case "3":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-three";
            break;
        case "4":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-four";
            break;
        case "5":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-five";
            break;
        case "6":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-six";
            break;
        case "8":
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-eight";
            break;
        default:
            $thumb_size = "portfolio-square";
            $item_size = "portfolio-four";
    }
    $selected_categories = array();
    if ($categories != '') {
        $selected_categories = explode(',', $categories);
    } else {
        $portfolio_category = get_terms('category');
        if ($portfolio_category) {
            foreach ($portfolio_category as $portfolio_cat) {
                array_push($selected_categories, $portfolio_cat->slug);
            }
        }
    }
    $paged = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);
    $params = get_post_custom();
    $args = array('paged' => $paged, 'posts_per_page' => $perpage, 'orderby' => 'date&order=ASC', 'category_name' => $categories);
    ?>
            
		<?php 
    // Filter begin
    if ($show_filter == "yes") {
        $portfolio_category = get_terms('category');
        if ($portfolio_category && count($selected_categories) > 1) {
            ?>
        <div class="centered-block-outer">
 			<div class="centered-block-middle">
  				<div class="centered-block-inner">
		<ul class="blog-tabs">
            <li class="active"><a data-filter="*" href="#">All</a></li>
			<?php 
            foreach ($portfolio_category as $portfolio_cat) {
                ?>
            <?php 
                if (in_array($portfolio_cat->slug, $selected_categories)) {
                    ?>
    		<li><a data-filter=".<?php 
                    echo $portfolio_cat->slug;
                    ?>
" href="#"><?php 
                    echo $portfolio_cat->name;
                    ?>
</a></li>
			<?php 
                }
                ?>
			<?php 
            }
            ?>
		</ul>
        </div>
        </div>
        </div>
		<?php 
        }
    }
    // Filter end
    ?>
<div class="clearboth"></div>        

<div class="<?php 
    echo $item_size;
    ?>
 blog-grid-container">
<div class="blog-grid masonry">
<?php 
    $newsquery = new WP_Query($args);
    while ($newsquery->have_posts()) {
        $newsquery->the_post();
        ?>
			<?php 
        $item_classes = '';
        $item_cats = get_the_terms($post->ID, 'category');
        if ($item_cats) {
            foreach ($item_cats as $item_cat) {
                $item_classes .= $item_cat->slug . ' ';
                $category = $item_cat->name;
            }
        }
        ?>

	<div class="portfolio-item-wrapper <?php 
        echo $item_classes;
        ?>
">
    
    <div id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class('');
        ?>
>
    <div class="portfolio-item">
        			<?php 
        // if there is a Featured Video
        if (get_post_meta(get_the_ID(), "_dynamo-featured-video", true) != '') {
            ?>
	<p>
	<?php 
            echo wp_oembed_get(get_post_meta(get_the_ID(), "_dynamo-featured-video", true));
            ?>
	</p>
	<?php 
        } elseif (has_post_thumbnail() && get_post_format() != 'gallery') {
            ?>
	<figure class="featured-image">
		<a href="<?php 
            the_permalink();
            ?>
">
        <div class="text-overlay"> 
		<div class="info">
		<span><i class="icon-link23"></i></span>   	
        </div>
        </div>
		<?php 
            the_post_thumbnail();
            ?>
		</a>
	</figure>
	<?php 
        }
        ?>
    <?php 
        if (get_post_format() == 'gallery') {
            // Load images
            $gallery = get_post_gallery($post->ID, false);
            $images = explode(",", $gallery['ids']);
            ?>
        <?php 
            if ($gallery) {
                dynamo_add_flex();
                ?>
        <div class="clearboth"></div>
			<div id="gallery" class="flexgallery">
                    			<?php 
                $gallery_id = "flexslider_" . mt_rand();
                $output = '<script type="text/javascript">' . "\n";
                $output .= "   jQuery(document).ready(function() {" . "\n";
                $output .= "jQuery('#" . $gallery_id . "').flexslider({" . "\n";
                $output .= '    animation: "slide",' . "\n";
                $output .= '    slideshowSpeed:"5000",' . "\n";
                $output .= '    controlNav: false,' . "\n";
                $output .= '    pauseOnHover: true,' . "\n";
                $output .= '    smoothHeight: true' . "\n";
                $output .= "  });" . "\n";
                $output .= "   });" . "\n";
                $output .= "</script>" . "\n";
                echo $output;
                ?>

            <div class="flexslider" id="<?php 
                echo $gallery_id;
                ?>
"><ul class="slides">
				<?php 
                foreach ($images as $image) {
                    $src = wp_get_attachment_image_src($image, 'full');
                    ?>
				<li><figure class="noscale">
				<img src="<?php 
                    echo $src[0];
                    ?>
" />
				</figure></li>
				<?php 
                }
                ?>
			</ul></div>
			</div>
		  	<?php 
            }
        }
        ?>
        <?php 
        if (get_post_format() != 'link' && get_post_format() != 'quote' && get_post_format() != 'status' && get_post_format() != 'audio') {
            ?>

     <?php 
        }
        ?>
		<section class="summary <?php 
        echo get_post_format();
        ?>
">
        <?php 
        $post_format = get_post_format();
        switch ($post_format) {
            case 'link':
                $more = 0;
                echo '<i class="Default-link"></i>';
                the_content('');
                $more = 1;
                break;
            case 'audio':
                $more = 0;
                the_content('');
                $more = 1;
                break;
            case 'status':
                echo '<i class="Default-chat3"></i>';
                the_content('');
                $more = 1;
                break;
            case 'quote':
                echo '<i class="Default-quote-right"></i>';
                the_content('');
                $more = 1;
                break;
            default:
        }
        if ($post_format == '' || $post_format == 'video' || $post_format == 'audio' || $post_format == 'aside' || $post_format == 'gallery') {
            ?>
        
        <div class="item-description">
        <?php 
            dp_post_meta_mini();
            ?>
        <a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(esc_attr__('Permalink to %s', DPTPLNAME), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><h3><?php 
            the_title();
            ?>
</h3>
        </a>
        <?php 
            the_excerpt();
            ?>
        </div>
        <?php 
        }
        ?>
		</section>
	</div>
    </div>
    </div> 
   <?php 
    }
    ?>
       
   
   </div>
   <div class="clearboth"></div>
           <div class="centered-block-outer">
 			<div class="centered-block-middle">
  				<div class="centered-block-inner">
   					<?php 
    dp_content_nav($newsquery->max_num_pages, $range = 2);
    ?>
   				</div>
            </div>
           </div>
   </div>
<?php 
    wp_reset_query();
}