'3', 'no_of_column' => '3', ); $args = wp_parse_args($atts, $defaults); $args1 = array( 'post_type' => 'feature', 'posts_per_page' => $args['per_page'], 'orderby' =>'title', 'order' => 'asc' ); $loop = new WP_Query($args1); $features_item = ""; if ($loop->have_posts()) { while($loop->have_posts()) { $loop->the_post(); $icon = get_post_meta(get_the_ID(),'_fst_feature_icons',true); $feature_icon_color = get_post_meta(get_the_ID(),'_feature_icon_color',true); $feature_icon_bgcolor = get_post_meta(get_the_ID(),'_feature_icon_bgcolor',true); $img = get_the_post_thumbnail_url(); $img = ($img=="") ? get_template_directory_uri(). "/fst-framework/fst-customizer/assets/images/default-image.jpg" : $img; $fst_column_class = 'col-md-4 col-lg-4'; ob_start(); get_template_part('template-parts/addons/features/feature'); $fst_features_contents = ob_get_clean(); $contents = wp_trim_words( get_the_content(), 20 ); $replace = array('{{image}}','{{heading}}','{{content}}','{{column_class}}', '{{permalink}}','{{icon}}', '{{icon_color}}', '{{icon_bgcolor}}'); $to = array(esc_url($img),get_the_title(),strip_tags($contents), $fst_column_class, get_post_permalink(),$icon, $feature_icon_color, $feature_icon_bgcolor); $features_item .= str_replace($replace,$to, $fst_features_contents); } wp_reset_query(); return $features_item; } else { if(is_user_logged_in()) { echo "
Click Here to Manage Feature or Import demo data of theme.
"; } } } }