function block($instance)
    {
        extract($instance);
        $this->masonry_Posts();
        add_filter('circleflip_post_format_gallery_html', 'circleflip_gallery_masonaryformat', 10, 5);
        add_filter('circleflip_post_format_standard_html', 'circleflip_standard_masonaryformat', 10, 5);
        add_filter('circleflip_post_format_video_html', 'circleflip_video_masonaryformat', 10, 5);
        add_filter('circleflip_post_format_audio_html', 'circleflip_audio_masonaryformat', 10, 5);
        add_filter('circleflip_post_format_media_size', 'circleflip_full_video_size', 10, 5);
        add_filter('circleflip_post_format_meta', 'circleflip_gallery_layout', 10, 5);
        /*
         * Latest Posts - Popular - Selected Posts
         * Blog Posts - Portfolio
         * with Latest or Popular (Selected Categories Multiple Select)
         * Order -> Ascending or descending
         * Number of Posts
         */
        switch ($post_type) {
            // Latest
            case '0':
                $args = array('posts_per_page' => $post_number, 'cat' => isset($post_selected_cats) ? implode(',', $post_selected_cats) : '', 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC', 'post_status' => 'publish');
                break;
                // Popular
            // Popular
            case '1':
                global $wpdb;
                $args = array('posts_per_page' => $post_number, 'post_type' => 'post', 'orderby' => 'post__in', 'post_status' => 'publish', 'cat' => isset($post_selected_cats) ? implode(',', $post_selected_cats) : '', 'post__in' => $wpdb->get_col("SELECT post_id, COUNT(*) as total FROM views_count WHERE 1 = 1 GROUP BY post_id ORDER BY total {$post_order}"), 'order' => 'DESC');
                break;
                // Selected Posts
            // Selected Posts
            case '2':
                if (circleflip_valid($post_selected_posts)) {
                    $selectedPosts = implode(",", $post_selected_posts);
                } else {
                    $selectedPosts = '';
                }
                $args = array('include' => $selectedPosts, 'orderby' => 'date', 'order' => 'DESC');
                break;
            default:
                break;
        }
        $output = circleflip_query($args);
        switch ($type) {
            case '0':
                $layout = 'span4';
                break;
            case '1':
                $layout = 'span3';
                break;
            default:
                $layout = 'span4';
                break;
        }
        if ($output) {
            ?>
			<div class="masonary">
				<div class="dotHeader"></div>
				<div class="titleBlock"><h3><?php 
            echo esc_html($title);
            ?>
</h3></div>
			</div>
			<div class="row masonryRow">
				<div class="loading_portfolio"></div>
				<div class="masonryContainer clearfix">
					<?php 
            foreach ($output as $post) {
                setup_postdata($post);
                ?>
				  <div class="masonryItem <?php 
                echo esc_attr($layout);
                ?>
">
				  	<div class="masonryItemInner">
						<?php 
                echo circleflip_get_post_format_media($post->ID, 'masonry_post', 'my_unique_masonary_posts');
                ?>
				  	</div>
				  </div>

				<?php 
            }
            echo '</div></div>';
        }
        circleflip_end_query();
    }
<!-- ITEM -->
<?php 
tha_entry_before();
?>
<li <?php 
post_class(array('item'));
?>
>
	<?php 
tha_entry_top();
?>
		<?php 
echo circleflip_get_post_format_media(get_the_ID());
?>
	<?php 
tha_entry_bottom();
?>
</li>
<?php 
tha_entry_after();
	    			<div class="portfolioHomeImg">
					<?php 
            if (circleflip_valid($image_recent)) {
                ?>
					    <?php 
                echo wp_get_attachment_image($image_id, 'recent_home_posts');
                ?>
					<?php 
            } else {
                ?>
					    <?php 
                echo circleflip_get_default_image('recent_home_posts');
                ?>
					    <?php 
            }
            echo circleflip_get_post_format_media($post->ID, 'recent_home_posts', 'my_unique_portfolio_posts');
            ?>
	    			</div>
	    		    </div>
				<?php 
            if ($relatedCount > $relatedNumber) {
                $relatedCount = 0;
            }
            ?>
			    <?php 
        }
        ?>
			</div>
			<?php 
    }
    $post = $tmp_post;
<?php

$categories = circleflip_get_portfolio_categories(get_the_ID());
$tags = circleflip_get_portfolio_tags(get_the_ID());
$project_details = circleflip_get_portfolio_meta(get_the_ID(), 'project_details', array());
?>
<div class="portfolioImage span12 grid3">
	<?php 
echo circleflip_get_post_format_media();
?>
	<?php 
// the_post_thumbnail()
?>
</div>
<div class="span12">
	<div class="row">
		<div class="span8 portfolioText">
			<h3><?php 
the_title();
?>
</h3>
			<?php 
if (!empty($categories)) {
    ?>
			<h6>
				<strong class="singlePortCat">
					<?php 
    esc_html_e('Category', 'circleflip');
    ?>
: 
					<span class="color">
function circleflip_mag4_loadmore()
{
    add_filter('circleflip_post_format_standard_html', 'circleflip_standard_mag4format', 10, 5);
    add_filter('circleflip_post_format_gallery_html', 'circleflip_standard_mag4format', 10, 5);
    add_filter('circleflip_post_format_video_html', 'circleflip_standard_mag4format', 10, 5);
    add_filter('circleflip_post_format_audio_html', 'circleflip_standard_mag4format', 10, 5);
    add_filter('circleflip_post_format_media_size', 'circleflip_standard_mag4format', 10, 5);
    add_filter('circleflip_post_format_meta', 'circleflip_standard_mag4format', 10, 5);
    /*
     * Latest Posts - Popular - Selected Posts
     * Blog Posts - Portfolio
     * with Latest or Popular (Selected Categories Multiple Select)
     * Order -> Ascending or descending
     * Number of Posts
     */
    $post_or_portfolio = isset($_POST['post_or_portfolio']) && 'portfolio' == $_POST['post_or_portfolio'] ? 'circleflip-portfolio' : 'post';
    $cat_key = 'post' == $post_or_portfolio ? 'cat' : 'tax_query';
    if ('circleflip-portfolio' == $post_or_portfolio) {
        $tax_query = array(array('taxonomy' => 'circleflip-portfolio-cats', 'field' => 'id', 'terms' => isset($_POST['cat_id']) ? explode(',', $_POST['cat_id']) : array()));
    } else {
        $tax_query = isset($_POST['cat_id']) ? $_POST['cat_id'] : '';
    }
    switch ($_POST['post_type']) {
        // Latest
        case '0':
            $args = array('posts_per_page' => $_POST['postsnumber'], $cat_key => $tax_query, 'post_type' => $post_or_portfolio, 'orderby' => 'date', 'order' => 'DESC', 'paged' => $_POST['pageNumber'], 'post_status' => 'publish');
            break;
            // Popular
        // Popular
        case '1':
            global $wpdb;
            $args = array('posts_per_page' => $_POST['postsnumber'], 'post_type' => $post_or_portfolio, 'orderby' => 'post__in', 'post_status' => 'publish', $cat_key => $tax_query, 'post__in' => $wpdb->get_col("SELECT post_id, COUNT(*) as total FROM views_count WHERE 1 = 1 GROUP BY post_id ORDER BY total {$post_order}"), 'paged' => $_POST['pageNumber'], 'order' => 'DESC');
            break;
        default:
            $args = array('posts_per_page' => $_POST['postsnumber'], $cat_key => $tax_query, 'post_type' => $post_or_portfolio, 'orderby' => 'date', 'order' => 'DESC', 'paged' => $_POST['pageNumber'], 'post_status' => 'publish');
            break;
    }
    if (empty($_POST['cat_id'])) {
        unset($args[$cat_key]);
    }
    $output = circleflip_query($args);
    switch ($_POST['layout']) {
        case 'span4':
            $layout = 'span4';
            $image_size = 'recent_home_posts_two';
            break;
        case 'span3':
            $layout = 'span3';
            $image_size = 'recent_home_posts';
            break;
        case 'span6':
            $layout = 'span6';
            $image_size = 'magazine_half';
            break;
        default:
            $layout = 'span4';
            $image_size = 'recent_home_posts_two';
            break;
    }
    foreach ($output as $post) {
        $post->postData = '
				<div class="' . $_POST['layout'] . '  magazinePost magazinePost4">
							' . circleflip_get_post_format_media($post->ID, $image_size, 'my_unique_mag4_posts') . '
				</div>';
    }
    echo json_encode($output);
    die;
}
		<a href="#" class="postComment"><span class="icon-comment"></span><p class="color"><?php 
comments_number();
?>
 </p></a>
	    </div>
	</div>
    </div>
    <!-- Post Details -->
    <div class="postDetails">
	<!-- Post Image -->
	<div class="postImage <?php 
echo has_post_format('video') ? 'embedBlock iframe_container' : '';
?>
">
	    <?php 
echo circleflip_get_post_format_media($post->ID, 'blog_posts_4_full');
?>
	</div>
	<a href="<?php 
the_permalink();
?>
">
	    <h2><?php 
the_title();
?>
</h2>
	</a>
	<div class="clearfix postText">
	    <p>
		<?php 
echo circleflip_string_limit_characters(get_the_excerpt(), '800');
Example #7
0
    function squarePostsRed($instance)
    {
        extract($instance);
        $this->square_red_enqueue();
        add_filter('circleflip_post_format_gallery_html', 'circleflip_gallery_squareredformat', 10, 5);
        add_filter('circleflip_post_format_standard_html', 'circleflip_standard_squareredformat', 10, 5);
        add_filter('circleflip_post_format_video_html', 'circleflip_video_squareredformat', 10, 5);
        add_filter('circleflip_post_format_audio_html', 'circleflip_audio_squareredformat', 10, 5);
        add_filter('circleflip_post_format_media_size', 'circleflip_full_video_size', 10, 5);
        add_filter('circleflip_post_format_meta', 'circleflip_gallery_layout', 10, 5);
        /*
         * Latest Posts - Popular - Selected Posts
         * Blog Posts - Portfolio
         * with Latest or Popular (Selected Categories Multiple Select)
         * Order -> Ascending or descending
         * Number of Posts
         */
        $post_selected_cats = isset(${"post_selected_cats_{$post_cat_type}"}) ? ${"post_selected_cats_{$post_cat_type}"} : array();
        $output = circleflip_query($this->build_query_args($instance));
        switch ($type) {
            case '0':
                $layout = 'span4';
                $image_size = 'recent_home_posts_two';
                break;
            case '1':
                $layout = 'span3';
                $image_size = 'recent_home_posts';
                break;
            default:
                $layout = 'span4';
                $image_size = 'recent_home_posts_two';
                break;
        }
        $image_size = !empty($instance['masonry']) ? 'masonry-post' : $image_size;
        $masonry_class = !empty($instance['masonry']) ? ' cf-masonry' : '';
        $titleIconClass;
        switch ($titleIcon) {
            case 0:
                $titleIconClass = 'withoutIcon';
                break;
            case 1:
                $titleIconClass = 'withIcon';
                break;
            default:
                $titleIconClass = 'withoutIcon';
        }
        $titleIconHead = '';
        if ($titleIconClass == 'withIcon') {
            $iconHead;
            if (defined("ICL_LANGUAGE_CODE") && "ar" === ICL_LANGUAGE_CODE) {
                $iconHead = "icon-left-open-mini";
            } else {
                $iconHead = "icon-right-open-mini";
            }
            $titleIconHead = '<div class="headerDot"><span class="' . esc_attr($iconHead) . '"></span></div>';
        }
        if ($output) {
            ?>
					<div class="squarePostsRedWrapper">
						<?php 
            if (circleflip_valid($title) || $post_type != 2 && $reload_section == "enable") {
                ?>
							<div class="portfolio titleBlock">
								<?php 
                if (circleflip_valid($title)) {
                    ?>
									<h3>
										<?php 
                    echo $titleIconHead . esc_html($title);
                    ?>
									</h3>
								<?php 
                }
                ?>
								<?php 
                if ($post_type != 2 && $reload_section == "enable") {
                    ?>
									<?php 
                    if (!circleflip_valid($title)) {
                        ?>
										<h3></h3>
									<?php 
                    }
                    ?>
									<a class="loadSquareRedPosts"
									   data-pagenumber="2"
									   data-layout="<?php 
                    echo esc_attr($layout);
                    ?>
"
									   data-posttype="<?php 
                    echo esc_attr($post_type);
                    ?>
"
									   data-postsnumber="<?php 
                    echo esc_attr($post_number);
                    ?>
"
									   data-cats="<?php 
                    echo isset($post_selected_cats) ? esc_attr(implode(',', $post_selected_cats)) : '';
                    ?>
"
									   data-post-or-portfolio="<?php 
                    echo esc_attr($post_cat_type);
                    ?>
">
										<span class="icon-spin3"></span> </a>
								<?php 
                }
                ?>
							</div>
						<?php 
            }
            ?>
						<div class="circleFlip row <?php 
            if (!empty($instance['masonry'])) {
                ?>
cf-masonry-container<?php 
            }
            ?>
">
							<ul class="ourHolder">
								<?php 
            global $post;
            foreach ($output as $post) {
                setup_postdata($post);
                ?>
									<li class="circleflip-portfolio squarered <?php 
                echo esc_attr($layout . ' ' . $entrance_animation . $masonry_class);
                ?>
 item animateCr">
										<?php 
                echo circleflip_get_post_format_media($post->ID, $image_size, 'my_unique_squarered_posts');
                ?>
									</li>
								<?php 
            }
            ?>
							</ul>
						</div>
					</div>
					<?php 
        }
        circleflip_end_query();
    }