<!-- Permalink --> <a href="<?php the_permalink(); ?> " class="post-details--permalink" rel="bookmark" title="<?php the_title_attribute(); ?> "><?php the_title(); ?> </a> <!-- Exerpt --> <p class="post-details--exerpt"> <?php $content = get_the_content(); echo blog_piece($content, 550); // in bones ?> ... </p> <!-- Bottom post details panel --> <div class="post-details--bottom-panel row"> <div class="col"> <ul class="post-details--meta no-list"><?php $categories = get_the_category(); //fetch the category $cat = my_category($categories); ?> <li><span>В рубрике: </span><a href="<?php echo $cat[link];
function my_recent_posts_shortcode($atts) { $q = new WP_Query(array('orderby' => 'date', 'posts_per_page' => '3')); $list = '<div class="row">'; while ($q->have_posts()) { $q->the_post(); $content = get_the_content(); $list .= '<div class="col-third">' . '<div class="latest-post"><span class="latest-post-time">' . get_the_time('d F', $post) . '</span>' . '<a class="latest-post-title-link" href="' . get_permalink() . '">' . get_the_title() . '</a>' . '<p class="latest-post-exerpt">' . blog_piece($content, 350) . '...</p>' . '<p><a href="' . get_permalink() . '">' . 'читать далее' . '</a></p>' . '</div>' . '</div>'; } wp_reset_query(); return $list . '</div>'; }