'post', 'posts_per_page'=>6, 'cat'=> absint( $category ) ); $loop = new WP_Query($args); if( $loop->have_posts() ){ while( $loop->have_posts() ) : $loop->the_post(); hotelgalaxy_room_item(); endwhile; wp_reset_postdata(); } } } } // if(!function_exists('hotelgalaxy_room_item')){ function hotelgalaxy_room_item(){ $is_button = hotelgalaxy_get_option('room_is_button'); $button_text = hotelgalaxy_get_option('room_button_text'); $target = hotelgalaxy_get_option('room_is_target') ? '_blank' : '_self'; ?>
>
', esc_url( get_permalink() ) ), '' ); echo apply_filters( 'the_content', wp_trim_words( get_the_content(), 15, '...' ) ); if(!empty( $button_text ) && ( $is_button == true )){ echo sprintf( '', the_title_attribute( 'echo=0' ), esc_url( get_permalink() ), esc_html( $button_text ), esc_attr( $target ) ); } ?>