Tạo element news trên flatsome

<?php function news_ux_builder_element()
{
    add_ux_builder_shortcode('inno_news', array(
        'name' => __('News Element') ,
        'category' => __('Content') ,
        'priority' => 1,
        'options' => array(
            'text' => array(
                'type' => 'textfield',
                'heading' => 'Category',
                'default' => ", 'auto_focus' => true, ), ), )); } add_action('ux_builder_setup', 'news_ux_builder_element'); function inno_news_func($atts){ extract(shortcode_atts(array( 'text' => ",
            ) ,
            $atts
        )
    );
    ob_start(); //echo '
    '.$text.''; $args = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 5, 'tax_query' => array( array( 'taxonomy' => 'category', 'field' => 'term_id', 'terms' => $text ) ) ); $news = new WP_Query( $args ); //echo $text; if( $news->have_posts() ) : ?> <ul class="box–news“> <?php $i=1; while( $news->have_posts() ) : $news->the_post(); if($i==1){ ?> <div class="row“> <div class="col medium-5 small-12 large-5"> <div class="col–inner“> <div class="img has–hover x md–x lg–x y md–y lg–y“> <a href="<?php echo get_the_permalink(); ?>"> <div class="img–inner dark“> <img width="600" height="400" src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>" class="attachment–large size–large" alt=""> </div> </a> </div> </div> </div> <div class="col medium-7 small-12 large-7"> <div class="col–inner“> <a href="<?php echo get_the_permalink(); ?>"><h2 class="uppercase“><?php echo get_the_title(); ?></h2></a> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat…<a href="<?php echo get_the_permalink(); ?>">xem thêm</a></p> <h3>Xem thêm: </h3> <?php }else{ ?> <li><a class="normal" href="<?php echo get_the_permalink(); ?>"><h5><?php echo get_the_title(); ?></h5> </a></li> <?php } ?> <?php $i++; endwhile; wp_reset_postdata(); ?> </div> </div> </div> </ul> <?php else : esc_html_e( 'Nonewsdisplay!', 'innocom' ); endif; return ob_get_clean(); } add_shortcode('inno_news', 'inno_news_func'); ?>