* @copyright Copyright (c) 2014 Shuhei Nishimura (Hibou). * @license http://opensource.org/licenses/gpl-2.0.php GPLv2 * @link http://hibou-web.com */ function anywhere_list( $atts ) { global $post; extract( shortcode_atts( array( 'post_type' => 'post', 'cat_name' => '', 'num' => 10, 'class' => '', 'orderby' => 'post_date', 'order' => 'DESC', 'length' => '', 'taxonomy' => '', 'term' => '', 'field' => '', 'more' => '…', 'post_format' => 'standard', 'thumbnail' => 'on', 'size' => 'thumbnail', 'slider_mode' => '', ), $atts ) ); if ( ! empty( $taxonomy ) && ! empty( $term ) ) { $args = array( 'post_type' => $post_type, 'posts_per_page' => $num, 'orderby' => $orderby, 'order' => $order, 'tax_query' => array( array( 'taxonomy' => $taxonomy, 'field' => $field, 'terms' => $term, ) ) ); } else { $args = array( 'post_type' => $post_type, 'cat_name' => $cat_name, 'posts_per_page' => $num, 'order' => $order, 'orderby' => $orderby, ); } $list_posts = get_posts( $args ); $html = ''; $class = ( ! empty( $class ) ) ? "class='$class'" : ''; if ( empty( $list_posts ) ) { return; } $html .= '