function shortcode_post_grid($atts, $content = null) { extract(shortcode_atts(array('type' => 'portfolio_cat', 'columns' => '4', 'counts' => '12', 'cats' => '', 'posts' => '', 'order' => 'DESC', 'orderby' => 'date', 'filter' => 'yes', '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, 'filter' => $filter, 'paging' => $paging, 'post_type' => $post_type, 'taxonomy' => $taxonomy)); return $q->grid(); }
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();