コード例 #1
0
ファイル: portfolio.php プロジェクト: hoonio/PhoneAfrika
    function shortcode_handler($atts, $content = null)
    {
        wp_enqueue_script('adap-isotope', AdapCommon::get_base_url() . '/js/lib/isotope/jquery.isotope.min.js', array('jquery'), false, true);
        wp_enqueue_script('adap-portfolio', AdapCommon::get_base_url() . '/js/adap-portfolio.js', array('adap-isotope'), false, true);
        ob_start();
        $atts = $this->getPreparedAtts($atts, $content);
        $atts = shortcode_atts(array('items' => '10', 'paginate' => 'yes', 'categories' => '', 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_category', 'display' => 'content', 'columns' => '4', 'show_all_text' => 'Show All', 'show_title' => true, 'show_excerpt' => true, 'show_pagination' => true, 'show_item_categories' => true, 'show_filters' => true, 'filter_display' => 'text', 'link_behavior' => 'lightbox', 'order' => 'DESC', 'orderby' => 'date', 'generate_thumbnail' => 'true', 'exclude' => ''), $atts);
        extract($atts);
        $this->do_query($atts);
        ?>

		<?php 
        if (have_posts()) {
            ?>
		<?php 
            $categories = $this->getCurrentCategories($categories, $taxonomy);
            switch ($columns) {
                case 3:
                    $column_class = 'one-third span4';
                    $img_size = 'portfolio-three-column';
                    break;
                case 2:
                    $column_class = 'one-half span6';
                    $img_size = 'portfolio-two-column';
                    break;
                case 1:
                    $column_class = 'whole span12';
                    $img_size = 'portfolio-one-column';
                    break;
                default:
                    $column_class = 'one-fourth span3';
                    $img_size = 'portfolio-four-column';
                    break;
            }
            if ($generate_thumbnail == 'false') {
                $img_size = 'full';
            }
            $pp_gallery_string = sprintf('rel="prettyPhoto[%s]"', uniqid('gallery-'));
            $show_icon = $filter_display != 'icon' ? 'false' : 'true';
            $filter_icon_class = 'show-icon-' . $show_icon;
            ?>

		<div class="adap-portfolio">
			<?php 
            if ($show_filters != 'false') {
                ?>
				<ul class="filters <?php 
                echo $filter_icon_class;
                ?>
">
					<li><a title="<?php 
                echo $show_all_text;
                ?>
" href="#" class="filter-link active"
						   data-filter="*">
							<?php 
                if ($show_icon != 'false') {
                    ?>
								<i class="portfolio-category-icon icon-asterisk"></i>
							<?php 
                } else {
                    echo $show_all_text;
                }
                ?>
</a></li>
					<?php 
                foreach ($categories as $cat) {
                    $this->printFilterMarkup($cat, $show_icon);
                }
                ?>
				</ul>
			<?php 
            }
            ?>

			<div class="portfolio-thumbs">
				<?php 
            //make the_content() respect <!--more--> tags
            //by setting the global "$more" value.
            global $more;
            $orig_more = $more;
            $more = 0;
            //we remove this handler before we process the content
            //so we don't get an infinite loop
            remove_shortcode($this->sc_handle);
            add_shortcode($this->sc_handle, array($this, 'nested_portfolio_shortcode_handler'));
            ?>


				<?php 
            while (have_posts()) {
                the_post();
                ?>
					<?php 
                global $post;
                $pid = $post->ID;
                $a_class = '';
                $permalink = get_permalink();
                $href = $permalink;
                $external_link = get_post_meta($pid, '_adap_sc_external_link_override', true);
                $external_link = trim($external_link);
                if ($external_link && $external_link != '') {
                    $href = $external_link;
                }
                ?>
					<div
						class="portfolio-item <?php 
                echo $column_class;
                ?>
 <?php 
                $this->printCategoryClasses($pid, $taxonomy);
                ?>
">
						<div class="thumbnail">

							<div class="portfolio-image-preview">
								<div class="image-overlay">
									<div class="image-overlay-inner">

										<?php 
                if (has_post_thumbnail()) {
                    wp_enqueue_script('prettyphoto');
                    wp_enqueue_style('prettyphoto');
                    $lb_href = wp_get_attachment_image_src(get_post_thumbnail_id($pid), 'large');
                    $lb_href = $lb_href[0];
                    $custom_link = get_post_meta($pid, '_adap_sc_link_override', true);
                    $custom_link = trim($custom_link);
                    if ($custom_link && $custom_link != '') {
                        $lb_href = $custom_link;
                    }
                    if ($lb_href) {
                        ?>
												<a title="<?php 
                        the_title();
                        ?>
"
												   class="prettyphoto portfolio-lightbox-link"
												   href="<?php 
                        echo $lb_href;
                        ?>
" <?php 
                        echo $pp_gallery_string;
                        ?>
><i
														class="entypo-eye"></i> </a>
											<?php 
                    }
                }
                ?>

										<a title="<?php 
                the_title();
                ?>
"
										   href="<?php 
                echo $href;
                ?>
" <?php 
                echo $a_class;
                ?>
><i
												class="entypo-link"></i></a>

									</div>
								</div>
								<div class="image-wrapper invisible">
									<?php 
                echo get_the_post_thumbnail($pid, $img_size);
                ?>
								</div>
							</div>

							<?php 
                if ($show_title != 'false') {
                    ?>
								<h3 class="portfolio-preview-title"><a href="<?php 
                    echo $permalink;
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h3>
							<?php 
                }
                ?>

							<?php 
                if ($show_item_categories !== 'false') {
                    echo '<div class="portfolio-categories">';
                    echo get_the_term_list($pid, $taxonomy, '', ', ', '');
                    echo '</div>';
                }
                ?>

							<?php 
                if ($show_excerpt != 'false') {
                    ?>
								<div class="portfolio-item-excerpt">
									<?php 
                    echo get_the_excerpt();
                    ?>
								</div>
							<?php 
                }
                ?>

						</div>
					</div>


				<?php 
            }
            ?>
				<?php 
            //replace the portfolio handling
            remove_shortcode($this->sc_handle);
            $this->register_shortcode();
            $more = $orig_more;
            ?>
			</div>
			<!--End Thumbnails--></div>

		<?php 
            if ($show_pagination != 'false') {
                ?>
			<?php 
                if (function_exists('bones_page_navi')) {
                    ?>
				<div class="portfolio-pagination-links">
					<?php 
                    bones_page_navi();
                    ?>
				</div>
			<?php 
                } else {
                    ?>
				<nav class="wp-prev-next">
					<ul class="clearfix">
						<li class="prev-link"><?php 
                    next_posts_link(__('&laquo; Older Entries', 'adap_sc'));
                    ?>
</li>
						<li class="next-link"><?php 
                    previous_posts_link(__('Newer Entries &raquo;', 'adap_sc'));
                    ?>
</li>
					</ul>
				</nav>
			<?php 
                }
                ?>
		<?php 
            }
            ?>


	<?php 
        } else {
            ?>

		<article id="post-not-found" class="hentry clearfix">
			<header class="article-header">
				<h1><?php 
            _e("Oops, Post Not Found!", 'adap_sc');
            ?>
</h1>
			</header>
			<section class="entry-content">
				<p><?php 
            _e("Uh Oh. Something is missing. Try double checking things.", 'adap_sc');
            ?>
</p>
			</section>
		</article>

	<?php 
        }
        ?>

		<?php 
        $ret_val = ob_get_contents();
        ob_end_clean();
        wp_reset_query();
        return $ret_val;
    }
コード例 #2
0
ファイル: progress.php プロジェクト: hoonio/PhoneAfrika
function adap_sc_enqueue_progress_scripts()
{
    wp_register_script('jquery-waypoints', AdapCommon::get_base_url() . '/js/lib/waypoints.min.js', array('jquery'));
    wp_register_script('jquery-countto', AdapCommon::get_base_url() . '/js/lib/jquery.countTo.js', array('jquery'));
    wp_register_script('gauge', AdapCommon::get_base_url() . '/js/lib/gauge.min.js', array('jquery'));
}
コード例 #3
0
 public static function admin_enqueue_css()
 {
     wp_enqueue_style('adap-sc', AdapCommon::get_base_url() . '/css/adap-sc-admin.css');
 }