Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
function lex_news( $atts, $content ){ extract( shortcode_atts( array( 'count' => '5', 'pa_ids' => '', 'media' => 'yes', 'meta_bar' => 'yes', 'post_content' => 'yes', 'category_name' => 'blog', ), $atts ) ); if( !empty( $count ) ){ $posts = get_by_post_type( 'post', $count ); } else{ $post_list = explode( ",", $pa_ids ); $posts = get_posts_by_title( $post_list, 'post' ); } $html = ''; if( !empty( $posts ) ){ $html = '<div class="row">'; $counter = 0; foreach( $posts as $post ){ if( $counter == 3 ){ $html .= '</div><div class="row">'; $counter = 0; } $counter++; $post_meta = get_post_meta( $post->ID ); $position = lex_get_smeta( 'position', $post_meta, '' ); $read_more_icon = lex_get_option( 'read_more_icon' ); $html .= ' <div class="col-md-4"> <div class="practice-box team blog"> <div class="practice-box-wrap"> '.( $media == 'yes' ? '<div class="media"> '.lex_the_media( $post->ID ).' </div>' : '' ).' '.( $meta_bar == 'yes' ? '<div class="meta clearfix"> <p> <span class="pull-left"><i class="fa fa-bars"></i>'.lex_the_categories( $post->ID ).'</span> <span class="pull-right"><i class="fa fa-clock-o"></i>'.get_the_time( 'F j, Y', $post ).'</span> </p> </div>' : '' ).' <div class="content"> <p class="name text-left"> <a href="'.get_the_permalink( $post->ID ).'"> <strong>'.$post->post_title.'</strong> </a> </p> '.( $post_content == 'yes' ? '<p class="position text-left"> '.$post->post_excerpt.' </p>' : '' ).' </div> </div> '.( !empty( $read_more_icon ) ? ' <div class="practice-box-button"> <a href="'.get_the_permalink( $post->ID ).'"> <i class="fa fa-'.$read_more_icon.'"></i> </a> </div>' : '' ).' </div> </div> '; } $html .= '</div>'; } return $html;