当前位置: 首页>>代码示例>>PHP>>正文


PHP twoot_generator函数代码示例

本文整理汇总了PHP中twoot_generator函数的典型用法代码示例。如果您正苦于以下问题:PHP twoot_generator函数的具体用法?PHP twoot_generator怎么用?PHP twoot_generator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了twoot_generator函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: shortcode_blog_carousel

 function shortcode_blog_carousel($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => 'Recent News', 'type' => 'blog_cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '2'), $atts));
     $id = twoot_get_frontend_func('rand_num', 5);
     if (!in_array($type, array('blog_cat', 'blog_tag'), true)) {
         return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
     }
     switch ($type) {
         case 'blog_cat':
             $taxonomy = 'category';
             break;
         case 'blog_tag':
             $taxonomy = 'post_tag';
             break;
     }
     $q = new Twoot_Template_Carousel(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'post', 'taxonomy' => $taxonomy));
     $html = '<div class="the-carousel-list the-blog-list">';
     $html .= '<h5 class="carousel-title">' . $title . '</h5>';
     $html .= '<ul id="post-carousel-' . $id . '" class="clearfix">';
     $html .= $q->carousel();
     $html .= '</ul>';
     $html .= '</div>';
     $html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'b');
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:25,代码来源:blog-carousel.php

示例2: shortcode_product_carousel

 function shortcode_product_carousel($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => 'Recent Products', 'type' => 'product_cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
     global $woocommerce;
     $id = twoot_get_frontend_func('rand_num', 5);
     if (!in_array($type, array('product_cat', 'product_tag'), true)) {
         return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
     }
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'product', 'taxonomy' => $type));
     $products = new WP_Query($query->do_template_query());
     if ($products->have_posts()) {
         $html = '<div class="the-carousel-list the-product-list">';
         $html .= '<h5 class="carousel-title">' . $title . '</h5>';
         $html .= '<ul id="post-carousel-' . $id . '" class="products clearfix">';
         while ($products->have_posts()) {
             $products->the_post();
             $html .= twoot_generator('load_template', 'loop-product-carousel');
         }
         wp_reset_query();
         $html .= '</ul>';
         $html .= '</div>';
         $html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'd');
     } else {
         $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
     }
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:28,代码来源:product-carousel.php

示例3: shortcode_featured_product_carousel

 function shortcode_featured_product_carousel($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => 'Featrued Products', 'counts' => '16', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
     global $woocommerce;
     $id = twoot_get_frontend_func('rand_num', 5);
     $query_args = array('posts_per_page' => $counts, 'order' => $order, 'orderby' => $orderby, 'post_status' => 'publish', 'post_type' => 'product', 'no_found_rows' => 1);
     $query_args['meta_query'] = $woocommerce->query->get_meta_query();
     $query_args['meta_query'][] = array('key' => '_featured', 'value' => 'yes');
     $products = new WP_Query($query_args);
     if ($products->have_posts()) {
         $html = '<div class="the-carousel-list the-product-list">';
         $html .= '<h5 class="carousel-title">' . $title . '</h5>';
         $html .= '<ul id="post-carousel-' . $id . '" class="products clearfix">';
         while ($products->have_posts()) {
             $products->the_post();
             $html .= twoot_generator('load_template', 'loop-product-carousel');
         }
         wp_reset_query();
         $html .= '</ul>';
         $html .= '</div>';
         $html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'd');
     } else {
         $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the type option, the current type is not match!', 'Twoot_Toolkit') . '</div>';
     }
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:26,代码来源:featured-product-carousel.php

示例4: shortcode_latest_blog

 function shortcode_latest_blog($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => 'Latest Blog', 'top_counts' => '1', 'last_counts' => '3', 'cats' => '', 'posts' => ''), $atts));
     global $post;
     // Get Query
     $top_query = new Twoot_Query(array('counts' => $top_counts, 'cats' => $cats, 'posts' => $posts, 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'post', 'taxonomy' => 'category'));
     $last_query = new Twoot_Query(array('counts' => $last_counts + 1, 'cats' => $cats, 'posts' => $posts, 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'post', 'taxonomy' => 'category'));
     $do_top_query = new WP_Query($top_query->do_template_query());
     $do_last_query = new WP_Query($last_query->do_template_query());
     $count = 0;
     $html = '<div class="shortcode-latest-blog">';
     $html .= '<h5 class="sub-title">' . $title . '</h5>';
     $html .= '<div class="outer clearfix">';
     $html .= '<div class="the-top-loop column six">';
     $html .= '<div class="inner">';
     $html .= '<ul>';
     while ($do_top_query->have_posts()) {
         $do_top_query->the_post();
         $do_not_duplicate[] = $post->ID;
         $html .= '<li class="post-item clearfix">';
         $html .= twoot_generator('load_template', 'loop-top-latest-blog');
         $html .= '</li>';
     }
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     wp_reset_query();
     $html .= '<div class="the-last-loop column six">';
     $html .= '<div class="inner">';
     $html .= '<ul>';
     while ($do_last_query->have_posts()) {
         $do_last_query->the_post();
         if (in_array($post->ID, $do_not_duplicate)) {
             continue;
         }
         // Num class
         $count++;
         $num_class = $do_last_query->post_count % $count == 0 ? 'odd' : 'even';
         $html .= '<li class="post-item ' . $num_class . ' clearfix">';
         $html .= twoot_generator('load_template', 'loop-last-latest-blog');
         $html .= '</li>';
     }
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     wp_reset_query();
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:50,代码来源:latest-blog.php

示例5: shortcode_portfolio_carousel

 function shortcode_portfolio_carousel($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => 'Recent Works', 'tax' => 'cat', 'counts' => '16', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'false', 'speed' => '800', 'pause' => '5000', 'move_slides' => '4'), $atts));
     $id = twoot_get_frontend_func('rand_num', 5);
     if (!in_array($tax, array('cat', 'tag'), true)) {
         return $html = '<div class="the-not-posts">' . esc_attr__('Hi, please check the taxonomy option, the current tax is not match!', 'Twoot_Toolkit') . '</div>';
     }
     $q = new Twoot_Template_Carousel(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_' . $tax));
     $html = '<div class="the-carousel-list the-portfolio-carousel">';
     $html .= '<h5 class="carousel-title section-title">' . $title . '</h5>';
     $html .= '<ul id="post-carousel-' . $id . '" class="clearfix">';
     $html .= $q->carousel();
     $html .= '</ul>';
     $html .= '</div>';
     $html .= twoot_generator('carousel_script', $id, $auto, $speed, $pause, $move_slides, $tag = 'p');
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:17,代码来源:portfolio-carousel.php

示例6: shortcode_testimonial_carousel

 function shortcode_testimonial_carousel($atts, $content = null)
 {
     extract(shortcode_atts(array('counts' => '12', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'auto' => 'true', 'speed' => '800', 'pause' => '5000', 'mode' => 'fade'), $atts));
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'cats' => '', 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'testimonial', 'taxonomy' => ''));
     $do_query = new WP_Query($query->do_template_query());
     $html = '<div class="shortcode-testimonials shortcode-testimonial-carousel">';
     $html .= '<ul class="testimonial-carousel" data-auto="' . $auto . '" data-speed="' . $speed . '" data-pause="' . $pause . '" data-mode="' . $mode . '">';
     while ($do_query->have_posts()) {
         $do_query->the_post();
         $html .= '<li class="testimonial-item clearfix">';
         $html .= twoot_generator('load_template', 'loop-testimonial');
         $html .= '</li>';
     }
     wp_reset_postdata();
     $html .= '</ul>';
     $html .= '</div>';
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:19,代码来源:testimonial-carousel.php

示例7: shortcode_testimonials

 function shortcode_testimonials($atts, $content = null)
 {
     extract(shortcode_atts(array('counts' => '5', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date'), $atts));
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'cats' => '', 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => 'testimonial', 'taxonomy' => ''));
     $do_query = new WP_Query($query->do_template_query());
     $html = '<div class="shortcode-testimonials">';
     $html .= '<ul>';
     while ($do_query->have_posts()) {
         $do_query->the_post();
         $html .= '<li class="testimonial-item clearfix">';
         $html .= twoot_generator('load_template', 'loop-testimonial');
         $html .= '</li>';
     }
     wp_reset_postdata();
     $html .= '</ul>';
     $html .= '</div>';
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:19,代码来源:testimonial.php

示例8: carousel

 /**
  * Carousel
  * @since     1.0
  * @updated   1.0
  *
  */
 public function carousel()
 {
     extract($this->atts);
     $loop = $post_type == 'portfolio' ? 'portfolio' : 'blog';
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => $post_type, 'taxonomy' => $taxonomy));
     $do_query = new WP_Query($query->do_template_query());
     $this->entries = $do_query;
     // Check if it has posts
     if (empty($this->entries) || empty($this->entries->posts)) {
         return;
     }
     // Output HTML
     $html = '';
     while ($this->entries->have_posts()) {
         $this->entries->the_post();
         $html .= '<li class="post-item column">';
         $html .= twoot_generator('load_template', 'loop-' . $loop . '-carousel');
         $html .= '</li>';
     }
     wp_reset_query();
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:29,代码来源:class-template-carousel.php

示例9: widget

 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $title = apply_filters('widget_title', $instance['title']);
     $icons = twoot_generator('icons');
     $current_icons = twoot_get_frontend_func('opt', 'opt', 'widget_social_icons');
     $all_icons = array('behance', 'dribbble', 'facebook', 'flickr', 'fivehundredpx', 'gplus', 'linkedin', 'instagram', 'pinterest', 'rss', 'soundcloud', 'tumblr', 'twitter', 'vimeo', 'youtube');
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     echo '<div class="social-icons-wrap clearfix">';
     if (is_array($current_icons) && !empty($current_icons)) {
         foreach ($current_icons as $current_icon) {
             if (in_array($current_icon, $all_icons, true)) {
                 if ($icons[$current_icon]) {
                     echo '<a href="' . $icons[$current_icon] . '" class="' . $current_icon . '" rel="external"><i class="icon icon-' . $current_icon . '"></i></a>';
                 }
             }
         }
     }
     echo '</div>';
     echo $after_widget;
 }
开发者ID:sniezekjp,项目名称:staging-fs,代码行数:24,代码来源:social-icons.php

示例10: twoot_get_frontend_func

<?php

/**
 * @package WordPress
 * @subpackage ThemeWoot
 * @author ThemeWoot Team 
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
$gallery_id = twoot_get_frontend_func('meta', 'gallery_id');
echo twoot_generator('post_image', $gallery_id, 940, 450, true, true);
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:14,代码来源:format-full-image.php

示例11: get_header

 * @author ThemeWoot Team
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
get_header();
?>

<div class="site-content container pt pb clearfix">

<article id="primary-wrapper" class="twelve">
	<div class="inner">
	<?php 
echo twoot_generator('page_title', 'archive');
?>

	<?php 
$q = new Twoot_Template_Grid(array('columns' => twoot_get_frontend_func('opt', 'opt', 'portfolio_column'), 'counts' => twoot_get_frontend_func('opt', 'opt', 'portfolio_counts'), 'order' => 'DESC', 'orderby' => 'date', 'filter' => 'no', 'paging' => 'yes', 'post_type' => 'portfolio'));
echo $q->grid();
?>
	</div>
</article>
<!--end #primary-->

</div>
<!--end #content-->

<?php 
get_footer();
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:31,代码来源:taxonomy-portfolio_cat.php

示例12: the_title_attribute

    ?>
<figure class="featured-image img-preload img-hover">
	<a href="<?php 
    echo $link;
    ?>
" title="<?php 
    the_title_attribute();
    ?>
">
	<?php 
    echo twoot_get_frontend_func('resize_thumbnail', get_post_thumbnail_id(), get_the_title(), 460, 335, true);
    ?>
	<div class="overlay"></div>
	</a>
	<?php 
    echo twoot_generator('zoom', $type, 'carousel');
    ?>
</figure>
<?php 
}
?>
<header class="item-head">
	<?php 
echo get_the_term_list(get_the_ID(), 'portfolio_cat', '<div class="cats meta">', ', ', '</div>');
?>
	<h3 class="title"><a href="<?php 
echo $link;
?>
" title="<?php 
the_title_attribute();
?>
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:31,代码来源:loop-portfolio-carousel.php

示例13: while

    while (have_posts()) {
        the_post();
        ?>
				<li class="post-item">
				<?php 
        echo twoot_generator('load_template', 'loop-blog-default');
        ?>
				</li>
			<?php 
    }
    ?>
			</ul>
		</div>

		<?php 
    echo twoot_generator('pagination');
    ?>

	<?php 
} else {
    ?>

		<div class="the-not-posts"><?php 
    esc_attr_e('Sorry, there is no posts in the current categories, please add some items in the dashboard!', 'Twoot');
    ?>
</div>

	<?php 
}
?>
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:30,代码来源:index.php

示例14: post

 /**
  * Post
  * @since     1.0
  * @updated   1.0
  *
  */
 public function post()
 {
     extract($this->atts);
     // Get Query
     $query = new Twoot_Query(array('counts' => $counts, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => $post_type, 'taxonomy' => $taxonomy));
     $do_query = new WP_Query($query->do_related_query());
     $this->entries = $do_query;
     // Check if it has posts
     if (empty($this->entries) || empty($this->entries->posts)) {
         return;
     }
     // Output HTML
     $html = '<div class="related-posts pt mt">';
     $html .= '<h5 class="sub-title">' . $title . '</h5>';
     $html .= '<div class="outer">';
     $html .= '<ul class="clearfix">';
     while ($this->entries->have_posts()) {
         $this->entries->the_post();
         $html .= '<li class="item column six">';
         $html .= '<div class="inner clearfix">';
         $html .= twoot_generator('load_template', 'loop-related-posts');
         $html .= '</div>';
         $html .= '</li>';
     }
     wp_reset_query();
     $html .= '</ul>';
     $html .= '</div>';
     $html .= '</div>';
     return $html;
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:36,代码来源:class-template-related-posts.php

示例15: printf

?>
	<span class="date-link">
		<?php 
printf(__('On: <a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', 'Twoot'), esc_url(get_permalink()), esc_attr(get_the_time()), get_the_time(get_option('date_format')));
?>
	</span>
	<?php 
edit_post_link(__('Edit', 'Twoot'), '<span class="edit-link">', '</span>');
?>
</header>
<article class="entry-content clearfix">
	<?php 
echo twoot_generator('load_template', 'format-' . $format);
?>
	<?php 
echo twoot_generator('post_excerpt', 300, true, '...', __('Continue reading &raquo;', 'Twoot'));
?>
</article>
<footer class="entry-meta">
	<?php 
if ($tags_list = get_the_tag_list('', __(', ', 'Twoot'))) {
    ?>
	<span class="tags-link">
		<?php 
    printf(__('Tags: %1$s', 'Twoot'), $tags_list);
    ?>
	</span>
	<?php 
}
?>
</footer>
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:31,代码来源:loop-blog-default.php


注:本文中的twoot_generator函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。