예제 #1
0
파일: section.php 프로젝트: taeche/SoDoEx
    function section_template()
    {
        $classes = array();
        $max = $this->opt('max') ? $this->opt('max') : 6;
        $format = $this->opt('format');
        $classes[] = 'format-' . $format;
        $array = $this->opt('array');
        ?>

	<div class="pl-quickcarousel <?php 
        echo join(' ', $classes);
        ?>
 pl-animation-group row-no-response row-closed" data-max="<?php 
        echo $max;
        ?>
">

		<?php 
        $out = $this->get_content($array);
        if ($out == '') {
            $array = array(array('image' => pl_default_image()), array('image' => pl_default_image()), array('image' => pl_default_image()), array('image' => pl_default_image()), array('image' => pl_default_image()), array('image' => pl_default_image()), array('image' => pl_default_image()));
            $out = $this->get_content($array);
        }
        echo $out;
        ?>
	</div>



<?php 
    }
예제 #2
0
파일: section.php 프로젝트: taeche/SoDoEx
    function section_template()
    {
        $classes = array();
        $format = $this->opt('popshot_format');
        if ($format == 'shadow') {
            $classes[] = 'popshot-shadow';
        } elseif ($format == 'frame') {
            $classes[] = 'popshot-frame';
        } elseif ($format == 'nostyle') {
            $classes[] = 'popshot-nostyle';
        } else {
            $classes[] = 'popshot-browser';
        }
        $array = $this->opt('popshot_array');
        $height = $this->opt('popshot_height') ? $this->opt('popshot_height') : '300px';
        ?>
	
	<div class="popshot-wrap <?php 
        echo join(' ', $classes);
        ?>
" style="height: <?php 
        echo $height;
        ?>
;">
		<div class="pl-animation-group">
			<?php 
        $out = $this->get_content($array);
        if ($out == '') {
            $array = array(array('image' => pl_default_image(), 'width' => '600px', 'offset' => '-300px'));
            $out = $this->get_content($array);
        }
        echo $out;
        ?>
		</div>
		<div class="shelf-shadow"></div>
	</div>

<?php 
    }
예제 #3
0
    function section_template()
    {
        global $post;
        $post_type = $this->opt('flipper_post_type') ? $this->opt('flipper_post_type') : 'post';
        $pt = get_post_type_object($post_type);
        $shown = $this->opt('flipper_shown') ? $this->opt('flipper_shown') : '3';
        $total = $this->opt('flipper_total') ? $this->opt('flipper_total') : '10';
        $title = $this->opt('flipper_title') ? $this->opt('flipper_title') : $pt->label;
        $hide_link = $this->opt('flipper_hide_title_link') ? true : false;
        $show_excerpt = $this->opt('flipper_show_excerpt') ? $this->opt('flipper_show_excerpt') : false;
        $disable_show_love = $this->opt('disable_flipper_show_love') ? true : false;
        $format = $this->opt($this->id . '_format') ? $this->opt($this->id . '_format') : 'grid';
        $meta = $this->opt('flipper_meta') ? $this->opt('flipper_meta') : '[post_date] [post_edit]';
        $sizes = $this->opt('flipper_sizes') ? $this->opt('flipper_sizes') : 'aspect-thumb';
        $sorting = $this->opt('flipper_post_sort') ? $this->opt('flipper_post_sort') : 'DESC';
        $orderby = 'rand' == $this->opt('flipper_post_sort') ? 'rand' : 'date';
        $the_query = array('posts_per_page' => $total, 'post_type' => $post_type, 'orderby' => $orderby, 'order' => $sorting);
        if ($this->opt('flipper_meta_key') && $this->opt('flipper_meta_key') != '' && $this->opt('flipper_meta_value')) {
            $the_query['meta_key'] = $this->opt('flipper_meta_key');
            $the_query['meta_value'] = $this->opt('flipper_meta_value');
        }
        if ($this->opt('flipper_category') && $this->opt('flipper_category') != '') {
            $cat = get_category_by_slug($this->opt('flipper_category'));
            $the_query['category'] = $cat->term_id;
        }
        $posts = get_posts($the_query);
        if (!empty($posts)) {
            setup_postdata($post);
            ?>
				
				<?php 
            if (!$this->opt($this->id . '_hide_nav')) {
                ?>
				<div class="flipper-heading">
					<div class="flipper-heading-wrap">
						<div class="flipper-title pl-standard-title">
							<?php 
                echo $title;
                $archive_link = get_post_type_archive_link($post_type);
                if ($archive_link && !$hide_link) {
                    printf('<a href="%s" > %s</a>', $archive_link, __(' / View All', 'pagelines'));
                } else {
                    if ($post_type == 'post' && get_option('page_for_posts') && !is_home() && !$hide_link) {
                        printf('<a href="%s" > %s</a>', get_page_uri(get_option('page_for_posts')), __(' / View Blog', 'pagelines'));
                    }
                }
                ?>

						</div>
						<a class="flipper-prev pl-contrast" href="#"><i class="icon icon-angle-left"></i></a>
				    	<a class="flipper-next pl-contrast" href="#"><i class="icon icon-angle-right"></i></a>
					</div>
				</div>
				<?php 
            }
            ?>
				
				<div class="flipper-wrap">

				<ul class="row flipper-items text-align-center layout-<?php 
            echo $format;
            ?>
 flipper" data-scroll-speed="800" data-easing="easeInOutQuart" data-shown="<?php 
            echo $shown;
            ?>
">
		<?php 
        }
        ?>

			<?php 
        if (!empty($posts)) {
            foreach ($posts as $post) {
                setup_postdata($post);
                ?>


			<li style="">

				<div class="flipper-item fix">
					<?php 
                if (has_post_thumbnail()) {
                    echo get_the_post_thumbnail($post->ID, $sizes, array('title' => ''));
                } else {
                    printf('<img height="400" width="600" src="%s" alt="no image added yet." />', pl_default_image());
                }
                ?>

					<div class="flipper-info-bg"></div>
					<a class="flipper-info pl-center-inside" href="<?php 
                echo get_permalink();
                ?>
">

						<div class="pl-center-table"><div class="pl-center-cell">
							
							<?php 
                if ($format == 'masonry') {
                    ?>
								<h4>
									<?php 
                    the_title();
                    ?>
								</h4>
								<div class="metabar">
									<?php 
                    echo do_shortcode('[post_date]');
                    ?>
								</div>
							<?php 
                } else {
                    ?>
								<div class="info-text"><i class="icon icon-link"></i></div>
							<?php 
                }
                ?>
						</div></div>
						
					</a>
				</div><!--work-item-->
				<?php 
                if ($format == 'grid') {
                    ?>
				<div class="flipper-meta">
					<?php 
                    if (!$disable_show_love) {
                        echo pl_karma($post->ID);
                    }
                    ?>
					<h4 class="flipper-post-title"><a href="<?php 
                    echo get_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
					<div class="flipper-metabar"><?php 
                    echo do_shortcode(apply_filters('pl_flipper_meta', $meta, $post->ID, pl_type_slug()));
                    ?>
</div>
					<?php 
                    if ($show_excerpt) {
                        ?>
					<div class="flipper-excerpt pl-border">
						<?php 
                        the_excerpt();
                        ?>
					</div>
					<?php 
                    }
                    ?>
					
				</div>
				<?php 
                }
                ?>

				<div class="clear"></div>

			</li>

			<?php 
            }
        }
        if (!empty($posts)) {
            echo '</ul></div>';
        }
        //	wp_reset_query();
    }
예제 #4
0
    function section_template()
    {
        $cols = $this->opt('popthumb_cols') ? $this->opt('popthumb_cols') : 4;
        $item_array = $this->opt('popthumb_array');
        $format_upgrade_mapping = array('title' => 'popthumb_title_%s', 'text' => 'popthumb_text_%s', 'image' => 'popthumb_image_%s', 'thumb' => 'popthumb_thumb_%s');
        $item_array = $this->upgrade_to_array_format('popthumb_array', $item_array, $format_upgrade_mapping, $this->opt('popthumb_count'));
        $count = 1;
        $width = 0;
        $output = '';
        $item_array = !is_array($item_array) ? array(array(), array(), array()) : $item_array;
        $num = count($item_array);
        foreach ($item_array as $item) {
            $link = '';
            $title = pl_array_get('title', $item, 'PopThumb ' . $count);
            $text = pl_array_get('text', $item);
            $img = '';
            $attach_id = pl_array_get('image_attach_id', $item);
            if (pl_array_get('image', $item)) {
                $full_img = pl_array_get('image', $item);
            } elseif (pl_array_get('thumb', $item)) {
                $full_img = pl_array_get('thumb', $item);
            } else {
                $full_img = pl_default_image();
            }
            if (pl_array_get('thumb', $item)) {
                $thumb_url = pl_array_get('thumb', $item);
            } elseif ($attach_id && $attach_id != '') {
                $img = wp_get_attachment_image_src($attach_id, 'basic-thumb');
                $thumb_url = $img[0];
            } elseif (pl_array_get('image', $item)) {
                $thumb_url = pl_array_get('image', $item);
            } else {
                $thumb_url = pl_default_thumb();
            }
            $thumb = sprintf('<img src="%s" />', $thumb_url);
            if ($width == 0) {
                $output .= '<div class="row fix">';
            }
            $output .= sprintf('<div class="span%s fix">
					<a class="popthumb" href="%s" rel="prettyPhoto[%s]">
						<span class="popthumb-thumb pl-animation pl-appear pl-contrast">
							%s

						</span>
						<span class="expander"><i class="icon icon-plus"></i></span>
					</a>
					<div class="popthumb-text">
						<h4 data-sync="popthumb_title_%s">%s</h4>
						<div class="popthumb-desc" data-sync="popthumb_text_%s">
							%s
						</div>
					</div>
				</div>', $cols, $full_img, $this->meta['unique'], $thumb, $count, $title, $count, $text);
            $width += $cols;
            if ($width >= 12 || $count == $num) {
                $width = 0;
                $output .= '</div>';
            }
            $count++;
        }
        ?>
	
	<div class="popthumbs-wrap pl-animation-group">
		<?php 
        echo $output;
        ?>
	</div>

<?php 
    }
예제 #5
0
    function section_template()
    {
        global $post;
        $show_excerpt = $this->opt($this->id . '_excerpt', array('default' => false));
        $format = $this->opt($this->id . '_format', array('default' => 'masonry'));
        $gutter_class = $format == 'grid' ? 'with-gutter' : '';
        $post_type = $this->opt($this->id . '_post_type', array('default' => 'post'));
        $pt = get_post_type_object($post_type);
        $total = $this->opt($this->id . '_total', array('default' => 10));
        $meta = $this->opt($this->id . '_meta', array('default' => '[post_date] [post_edit]'));
        if ($this->opt($this->id . '_sizes') && $this->opt($this->id . '_sizes') != '') {
            $sizes = $this->opt($this->id . '_sizes');
        } elseif ($format == 'masonry') {
            $sizes = $this->get_masonry_image_size();
        } else {
            $sizes = 'aspect-thumb';
        }
        $sorting = $this->opt($this->id . '_post_sort', array('default' => 'DESC'));
        $orderby = 'rand' == $sorting ? 'rand' : 'date';
        $the_query = array('posts_per_page' => $total, 'post_type' => $post_type, 'orderby' => $orderby, 'order' => $sorting);
        if ($this->opt($this->id . '_meta_key') && $this->opt($this->id . '_meta_key') != '' && $this->opt($this->id . '_meta_value')) {
            $the_query['meta_key'] = $this->opt($this->id . '_meta_key');
            $the_query['meta_value'] = $this->opt($this->id . '_meta_value');
        }
        $filter_tax = $this->opt($this->id . '_category', array('default' => 'category'));
        $posts = get_posts($the_query);
        $filters = array();
        foreach ($posts as $post) {
            $terms = wp_get_post_terms($post->ID, $filter_tax);
            foreach ($terms as $t) {
                $filters[$t->slug] = $t->name;
            }
        }
        $args = array('taxonomy' => $filter_tax);
        $list = get_categories($args);
        if (is_array($list) && !empty($list)) {
            foreach ($list as $key => $l) {
                if (!isset($filters[$l->slug])) {
                    unset($list[$key]);
                }
            }
        }
        $default_title = $this->opt('default_title') ? $this->opt('default_title') : 'All';
        if (!empty($posts)) {
            ?>



			<div class="masonic-wrap">
				<div class="masonic-header pl-area-ui-element">
					<div class="masonic-header-wrap pl-content">
						<div class="masonic-header-content-pad fix">
							<div class="masonic-title"><?php 
            echo $default_title;
            ?>
</div>
							<ul class="masonic-nav inline-list">
								<lh>Sort:</lh>
								<li class="pl-link"><a href="#" data-filter="*">All</a></li>
								<?php 
            if (is_array($list) && !empty($list)) {
                foreach ($list as $key => $l) {
                    printf('<li><a href="#" data-filter=".%s">%s</a></li>', $l->slug, ucwords($l->name));
                }
            }
            ?>
							</ul>
						</div>
					</div>
				</div>
				<ul class="masonic-gallery row row-set <?php 
            echo $gutter_class;
            ?>
 no-transition"  data-format="<?php 
            echo $format;
            ?>
">
		<?php 
        }
        ?>

			<?php 
        if (!empty($posts)) {
            $item_cols = 3;
            $count = 1;
            $total = count($posts);
            foreach ($posts as $post) {
                setup_postdata($post);
                $filters = wp_get_post_terms($post->ID, $filter_tax);
                $filter_classes = array();
                if (is_array($filters) && !empty($filters)) {
                    foreach ($filters as $f) {
                        $filter_classes[] = $f->slug;
                    }
                }
                //	echo pl_grid_tool('row_start', $item_cols, $count, $total);
                ?>


			<li class="span3 <?php 
                echo join(' ', $filter_classes);
                ?>
">
				<div class="span-wrap pl-grid-wrap">
					<div class="pl-grid-image fix">
						<?php 
                if (has_post_thumbnail()) {
                    echo get_the_post_thumbnail($post->ID, $sizes, array('title' => ''));
                } else {
                    printf('<img src="%s" alt="no image added yet." />', pl_default_image());
                }
                ?>

						<div class="pl-grid-image-hover"></div>

						<a class="pl-grid-image-info" href="<?php 
                echo get_permalink();
                ?>
">

							<div class="pl-center-table"><div class="pl-center-cell">

								<?php 
                if ($format == 'masonry') {
                    ?>
									<h4>
										<?php 
                    the_title();
                    ?>
									</h4>
									<div class="metabar">
										<?php 
                    echo do_shortcode('[post_date]');
                    ?>
									</div>
								<?php 
                } else {
                    ?>
									<div class="info-text"><i class="icon icon-link"></i></div>
								<?php 
                }
                ?>
							</div></div>

						</a>
					</div><!--work-item-->

					<?php 
                if ($format == 'grid') {
                    ?>
						<div class="pl-grid-content fix">
							<div class="fix">
								<div class="pl-grid-meta">
									<?php 
                    echo pl_karma($post->ID);
                    ?>
								</div>
								<div class="pl-grid-text">
									<h4>
										<a href="<?php 
                    echo get_permalink();
                    ?>
">
										<?php 
                    the_title();
                    ?>
										</a>
									</h4>
									<div class="pl-grid-metabar">
										<?php 
                    echo do_shortcode($meta);
                    ?>
									</div>

								</div>
							</div>
							<?php 
                    if ($show_excerpt) {
                        ?>
							<div class="pl-grid-excerpt pl-border">
								<?php 
                        the_excerpt();
                        ?>
							</div>
							<?php 
                    }
                    ?>
							
						</div>
					<?php 
                }
                ?>

					<div class="clear"></div>
				</div>

			</li>

<?php 
                //echo pl_grid_tool('row_end', $item_cols, $count, $total);
                $count++;
            }
        }
        if (!empty($posts)) {
            echo '</ul></div>';
        }
        //	wp_reset_query();
    }