esc_html__("Portfolio Filter", 'taskereasy'), "base" => "taskereasy_portfolios", 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png', "class" => "", "description" => esc_html__("Add taskereasy portfolio grid", 'taskereasy'), "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'), "params" => array( array( "type" => "dropdown", "heading" => esc_html__("Type", 'taskereasy'), "param_name" => "portfolio_type", "value" => array('Two Columns' => 'col-two', 'Three Columns' => 'col-three') ), array( "type" => "checkbox", "heading" => esc_html__("Hide Filter", 'taskereasy'), "param_name" => "hide_filter", ), array( 'type' => 'css_editor', 'heading' => esc_html__( 'CSS', 'taskereasy' ), 'param_name' => 'custom_design', 'group' => esc_html__( 'Design options', 'taskereasy' ), ) ) )); add_shortcode( 'taskereasy_portfolios', function($atts, $content = null) { extract(shortcode_atts(array( 'blog_post' => '', 'portfolio_type' => 'col-two', 'hide_filter' => 'false', 'port_style' => 'v1', 'custom_design' => '', ), $atts)); $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' ); $portfoliotype = html_entity_decode(vc_value_from_safe($portfolio_type, true)); $poststyle = html_entity_decode(vc_value_from_safe($post_style, true)); $blogpost = html_entity_decode(vc_value_from_safe($blog_post, true)); $output = ''; $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $loop = new WP_Query( array( 'post_type' => 'portfolios', 'orderby' => 'title', 'order' => 'ASC', 'paged' => $paged, ) ); $output = ''; $output .= '
'; if($hide_filter != 'true'){ $output.= '
'; } if($portfoliotype == 'col-three') { $output .= ''; //container close on col-three } $output .= '
'; if( ! $loop->have_posts() ) { return false; } while( $loop->have_posts() ) { $loop->the_post(); $termname = array(); $terms = get_the_terms( '', 'portfoliocategories' ); if ( !empty( $terms ) ) { foreach ($terms as $term) { $termname[] = $term->name; } } $output .= ''; } //$output .= '
'; if($portfoliotype == 'col-three') { //$output .= ''; } $output .= '
'; wp_reset_postdata(); return $output; });