<?php 
}
?>
						<?php 
function circleflip_portfolio_loop($portfolio_query)
{
    if ($portfolio_query->have_posts()) {
        while ($portfolio_query->have_posts()) {
            $portfolio_query->the_post();
            get_template_part('partials/content', apply_filters('circleflip-portfolio-columns-template', 'portfolio-single-column'));
        }
    }
}
$wp_query = $tmp_wp_query;
$portfolio_query = null;
circleflip_end_query();
?>
				</div>
			</div>
			<?php 
?>
			<?php 
if ('none' !== $portfolio_page_meta['sidebar'] && !empty($portfolio_page_meta['which_sidebar'])) {
    ?>
				<section class="span3">
						<aside class="sidebar <?php 
    echo esc_attr($port_sidebar_width . ' ' . $reverse_classes[$portfolio_page_meta['sidebar']]['sidebar']);
    ?>
">
							<ul>
								<?php 
    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();
    }
Example #3
0
    function magazineStyle4($instance)
    {
        extract($instance);
        $this->magazine_style4_enqueue();
        /*
         * 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_mag) {
            case '0':
                $layout = 'span4';
                $image_size = 'recent_home_posts_two';
                break;
            case '1':
                $layout = 'span3';
                $image_size = 'recent_home_posts';
                break;
            case '2':
                $layout = 'span6';
                $image_size = 'magazine_half';
                break;
            default:
                $layout = 'span4';
                $image_size = 'recent_home_posts_two';
                break;
        }
        $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="magazineStyle magazineStyle4">
						<?php 
            if (circleflip_valid($title) || $post_type != 2 && $reload_section == "enable") {
                ?>
							<div class="titleBlock">
								<?php 
                if (circleflip_valid($title)) {
                    ?>
									<h3 class="alignLeft">
										<?php 
                    echo $titleIconHead . esc_html($title);
                    ?>
									</h3>
								<?php 
                }
                ?>
								<?php 
                if ($post_type != 2 && $reload_section == "enable") {
                    ?>
									<?php 
                    if (!circleflip_valid($title)) {
                        ?>
										<h3 class="alignLeft"></h3>
									<?php 
                    }
                    ?>
									<a class="loadMagazinePosts loadMagazine4Posts"
									   data-pagenumber="2"
									   data-posttype="<?php 
                    echo esc_attr($post_type);
                    ?>
"
									   data-layout="<?php 
                    echo esc_attr($layout);
                    ?>
"
									   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 
            global $post;
            foreach ($output as $post) {
                setup_postdata($post);
                ?>
								<div class="<?php 
                echo esc_attr($layout . ' ' . $entrance_animation);
                ?>
 magazinePost magazinePost4 animateCr">
									<!-- Magazine post Image -->
									<div class="image">
										<?php 
                if (has_post_thumbnail($post->ID)) {
                    ?>
											<?php 
                    echo get_the_post_thumbnail($post->ID, $image_size);
                    ?>
											<?php 
                } else {
                    echo circleflip_get_default_image($image_size);
                    ?>
										<?php 
                }
                ?>

									</div>
									<!-- Magazine post Right part -->
									<div class="magazineData">
										<!-- Magazine post Author -->
										<div class="magazinePostAuthor">
											<?php 
                echo get_avatar($post->post_author);
                ?>
											<a href="<?php 
                echo esc_url(get_author_posts_url($post->post_author));
                ?>
"><p><?php 
                the_author_meta('display_name');
                ?>
 </p></a>
										</div>
										<!-- Magazine post Date -->
										<div class="magazinePostDate">
											<p> /</p>
											<span><?php 
                echo get_the_date('d M Y');
                ?>
</span>
										</div>
										<!-- Magazine post title -->
										<?php 
                $original_title = $post->post_title;
                $mag_post_title = circleflip_string_limit_characters($original_title, '45');
                ?>
										<a  class="magazinePostTitle" href="<?php 
                the_permalink();
                ?>
"><h4><?php 
                echo esc_html($mag_post_title);
                ?>
</h4></a>
										<!-- Magazine post Categories -->
										<div class="magazineCategories">
											<?php 
                $post_categories = wp_get_post_categories(get_the_ID());
                $cats = array();
                for ($i = 0; $i < count($post_categories); $i++) {
                    $cat = get_category($post_categories[$i]);
                    $cat_name = $cat->name;
                    $cat_link = get_category_link($cat->cat_ID);
                    //$cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug );
                    if ($i != count($post_categories) - 1) {
                        echo ' <a href=' . esc_url($cat_link) . '><p>' . esc_html($cat_name) . ' , </p></a>';
                    } else {
                        echo ' <a href=' . esc_url($cat_link) . '><p>' . esc_html($cat_name) . '</p></a>';
                    }
                }
                ?>
										</div>
										<!-- Magazine post excerpt -->
										<?php 
                $original_text = sanitize_text_field($post->post_content);
                $mag_post_text = circleflip_string_limit_characters($original_text, '125');
                ?>
										<p class="magazinePostExcerpt"><?php 
                echo $mag_post_text;
                ?>
</p>
										<!-- Magazine post views & comments number -->
										<div class="magazinePostViews">
											<span class="icon-eye"></span>
											<span class="mag_views_no">
												<?php 
                if (cr_get_option("rtl", '0') == '1') {
                    $standard = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
                    $east_arabic = array("&#1632;", "&#1633;", "&#1634;", "&#1635;", "&#1636;", "&#1637;", "&#1638;", "&#1639;", "&#1640;", "&#1641;");
                    $numOfViews = circleflip_read_number_of_views(get_the_ID());
                    $numOfViews = str_replace($standard, $east_arabic, $numOfViews);
                } else {
                    $numOfViews = circleflip_read_number_of_views(get_the_ID());
                }
                echo esc_html($numOfViews);
                ?>
											</span>
										</div>
										<div class="magazinePostComments">
											<span class="icon-comment-1"></span>
											<span class="mag_comments_no">
												<?php 
                comments_number('0');
                ?>
											</span>
										</div>
										<div class="magazinePostBtn">
												<!-- <a href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('more..', 'circleflip');
                ?>
</a> -->
											<a href="<?php 
                the_permalink();
                ?>
" class="">
												<span><?php 
                _e('Read More..', 'circleflip');
                ?>
</span>
											</a>
										</div>
									</div>
								</div>
							<?php 
            }
            ?>
						</div>
					</div>
					<?php 
            if ($check_element_color == 1) {
                ?>
						<style>
				<?php 
                $id_modified = str_replace('_', '-', $block_id);
                ?>
							#<?php 
                echo $id_modified;
                ?>
 .magazinePost4 .image .magazinePostDate, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePostViews .mag_views_no, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePostComments .mag_comments_no, 
							#<?php 
                echo $id_modified;
                ?>
 [class*="btnStyle"].red{
								background-color: <?php 
                echo $elements_color;
                ?>
;
							}
							#<?php 
                echo $id_modified;
                ?>
 .magazinePostTitle h4:hover, 
							#<?php 
                echo $id_modified;
                ?>
 .color, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePost4 .magazinePostBtn a:hover, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePost4 .magazinePostAuthor p:hover, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePost4 .magazineCategories p{
								color: <?php 
                echo $elements_color;
                ?>
!important;
							}
							#<?php 
                echo $id_modified;
                ?>
 .magazinePostViews .mag_views_no, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePostComments .mag_comments_no, 
							#<?php 
                echo $id_modified;
                ?>
 .magazinePost4 .magazinePostBtn a:hover{
								border-color:  <?php 
                echo $elements_color;
                ?>
;
							}
						</style>
						<?php 
            }
        }
        circleflip_end_query();
    }