function shortcode_post_left_grid($atts, $content = null) { extract(shortcode_atts(array('type' => 'portfolio_cat', 'columns' => '4', 'counts' => '12', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'paging' => 'yes'), $atts)); if (!in_array($type, array('portfolio_cat', 'portfolio_tag', 'product_cat', 'product_tag', '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': $post_type = 'post'; $taxonomy = 'category'; break; case 'blog_tag': $post_type = 'post'; $taxonomy = 'post_tag'; break; case 'portfolio_cat': $post_type = 'portfolio'; $taxonomy = 'portfolio_cat'; break; case 'portfolio_tag': $post_type = 'portfolio'; $taxonomy = 'portfolio_tag'; break; case 'product_cat': $post_type = 'product'; $taxonomy = 'product_cat'; break; case 'product_tag': $post_type = 'product'; $taxonomy = 'product_tag'; break; } $q = new Twoot_Template_Grid(array('columns' => $columns, 'counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'paging' => $paging, 'post_type' => $post_type, 'taxonomy' => $taxonomy)); return $q->left_grid(); }
function shortcode_faqs($atts, $content = null) { extract($atts = shortcode_atts(array('counts' => '12', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'filter' => 'yes', 'post_type' => 'faq', 'taxonomy' => 'faq_cat'), $atts)); // Get Query $query = new Twoot_Query(array('counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'post_type' => $post_type, 'taxonomy' => $taxonomy)); $grid = new Twoot_Template_Grid(); $do_query = new WP_Query($query->do_template_query()); $faqs_class = $filter == 'yes' ? 'column nine' : 'twelve'; $html = '<div class="the-faq-list shortcode-toggle outer clearfix">' . "\n"; if ($filter == 'yes') { $html .= '<div class="column three">'; $html .= $grid->filter_terms_menu($do_query->posts, $atts); $html .= '</div>'; } $html .= '<div id="faqs" class="' . $faqs_class . '">'; while ($do_query->have_posts()) { $do_query->the_post(); //Get terms class $terms_class = $grid->filter_terms_class(get_the_ID(), $atts); $html .= '<div class="tog-item faq-item inner ' . $terms_class . '">'; $html .= '<a href="#" class="tog"><i class="icon twoot-icon"></i>' . get_the_title() . '</a>'; $html .= '<div class="tog-content clearfix">' . do_shortcode(get_the_content()) . '</div>'; $html .= '</div>'; } wp_reset_query(); $html .= '</div>'; $html .= '</div>'; return $html; }
function shortcode_portfolio_grid($atts, $content = null) { extract(shortcode_atts(array('tax' => 'cat', 'columns' => '4', 'counts' => '12', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'filter' => 'yes', 'paging' => 'yes'), $atts)); 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_Grid(array('columns' => $columns, 'counts' => $counts, 'cats' => $cats, 'posts' => $posts, 'order' => $order, 'orderby' => $orderby, 'filter' => $filter, 'paging' => $paging, 'post_type' => 'portfolio', 'taxonomy' => 'portfolio_' . $tax)); return $q->grid(); }
* @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();