コード例 #1
0
    	</div>
        </div>
		<?php 
        the_post_thumbnail();
        ?>
            
		</a>
	</figure>
<?php 
        break;
    }
    if (get_post_format() == 'gallery') {
        $gallery = get_post_gallery($post->ID, false);
        $images = explode(",", $gallery['ids']);
        if ($gallery && isset($gallery['ids'])) {
            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(window).load(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";
コード例 #2
0
ファイル: shortcodes.php プロジェクト: Karpec/geo-mac
function dp_carousel($atts)
{
    //extract short code attr
    extract(shortcode_atts(array('id' => '', 'itemwidth' => '190', 'itemmargin' => '5', 'minitem' => '3', 'maxitem' => '5'), $atts));
    dynamo_add_flex();
    include_once get_template_directory() . '/dynamo_framework/helpers/helpers.contentcarousel.php';
    $return_html = contentcarousel($id, $itemwidth, $itemmargin, $minitem, $maxitem);
    return $return_html;
}
コード例 #3
0
/**
 *
 * 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();
}
コード例 #4
0
ファイル: widgets.newsflash.php プロジェクト: Karpec/geo-mac
 /**
  *
  * Outputs the HTML code of this widget.
  *
  * @param array An array of standard parameters for widgets in this theme
  * @param array An array of settings for this widget instance
  * @return void
  *
  **/
 function widget($args, $instance)
 {
     $cache = wp_cache_get('widget_dp_newsflash', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = null;
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     ob_start();
     //
     extract($args, EXTR_SKIP);
     //
     $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
     // get settings
     $this->config['style'] = empty($instance['style']) ? 'light' : $instance['style'];
     $this->config['catid'] = empty($instance['catid']) ? 'uncategorized' : $instance['catid'];
     $this->config['article_count'] = empty($instance['article_count']) ? '4' : $instance['article_count'];
     $this->config['itemsOrdering'] = empty($instance['itemsOrdering']) ? 'date' : $instance['itemsOrdering'];
     $this->config['usetitle'] = empty($instance['usetitle']) ? 'titel' : $instance['usetitle'];
     $this->config['content_type'] = empty($instance['content_type']) ? 'content' : $instance['content_type'];
     $this->config['pretext'] = empty($instance['pretext']) ? 'Breaking News' : $instance['pretext'];
     $this->config['controls'] = empty($instance['controls']) ? 'on' : $instance['controls'];
     $this->config['animation'] = empty($instance['animation']) ? 'slide' : $instance['animation'];
     $this->config['direction'] = empty($instance['direction']) ? 'horizontal' : $instance['direction'];
     $this->config['duration'] = empty($instance['duration']) ? '600' : $instance['duration'];
     $this->config['delay'] = empty($instance['delay']) ? '2500' : $instance['delay'];
     $this->config['news_indent'] = empty($instance['news_indent']) ? '75' : $instance['news_indent'];
     $this->config['preview_count'] = empty($instance['preview_count']) ? '75' : $instance['preview_count'];
     //
     echo $before_widget;
     echo $before_title;
     echo $title;
     echo $after_title;
     dynamo_add_flex();
     // render the layout
     // Query Init
     $catslug = get_category_by_slug($this->config['catid']);
     $dpnewsflash = new WP_Query('cat=' . $catslug->term_id . '&posts_per_page=' . $this->config['article_count'] . '&orderby=' . $this->config['itemsOrdering']);
     $wid = "flexslider_" . mt_rand();
     echo '<script type="text/javascript">' . "\n";
     echo "   jQuery(window).load(function() {" . "\n";
     echo "jQuery('#" . $wid . "').flexslider({" . "\n";
     echo '    animation: "' . $this->config['animation'] . '",' . "\n";
     echo '    direction: "' . $this->config['direction'] . '",' . "\n";
     echo '    slideshowSpeed:"' . $this->config['delay'] . '",' . "\n";
     echo '    animationSpeed:"' . $this->config['duration'] . '",' . "\n";
     echo '    controlNav: false,' . "\n";
     echo '    directionNav:false,' . "\n";
     echo '	   start: function(slider){' . "\n";
     echo '	   jQuery("#prev").click(function(){' . "\n";
     echo '    slider.flexAnimate(slider.getTarget("prev"), true);' . "\n";
     echo '    });' . "\n";
     echo '    jQuery("#next").click(function(){' . "\n";
     echo '    slider.flexAnimate(slider.getTarget("next"), true);' . "\n";
     echo '  });' . "\n";
     echo '  }' . "\n";
     echo "  });" . "\n";
     echo "   });" . "\n";
     echo "</script>" . "\n";
     echo '<div id="dp-newsflash" class="' . $this->config['style'] . '">';
     echo '<span class="leading-text">' . $this->config['pretext'] . '</span>';
     if ($this->config['controls'] == true) {
         echo '<div class="controls"><a id="prev"></a><a id="next"></a></div>';
     }
     echo '<div class="newsline">';
     echo '<div class="flexslider" id="' . $wid . '" style="margin-left:' . $this->config['news_indent'] . 'px;margin-right:40px;"><ul class="slides" >';
     if ($dpnewsflash->have_posts()) {
         while ($dpnewsflash->have_posts()) {
             $dpnewsflash->the_post();
             echo '<li>';
             echo '<a href="' . get_permalink() . '">';
             if ($this->config['usetitle'] == 'title') {
                 the_title();
             } else {
                 if ($this->config['content_type'] == 'content') {
                     echo $this->prepareDPContent(get_the_content(false), $this->config['preview_count']) . '&hellip;';
                 } else {
                     echo $this->prepareDPContent(get_the_excerpt(), $this->config['preview_count']) . '&hellip;';
                 }
             }
             echo '</a>';
             echo '</li>';
         }
     }
     echo '</ul></div></div>';
     echo '';
     echo '</div>';
     wp_reset_query();
     //
     echo $after_widget;
     // save the cache results
     $cache[$args['widget_id']] = ob_get_flush();
     wp_cache_set('widget_dp_newsflash', $cache, 'widget');
 }