@stephania Вы можете вывести последние записи в Wordpress используя WP_Query() метод и создать запрос для получения записей из базы, посмотрите пример получения 5 последних записей в Wordpress:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<?php $args = [ 'post_type' => 'post', 'posts_per_page' => '5' ]; $the_query = new WP_Query($args); // Цикл if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; ?> <?php else : ?> <p>записей не найдено</p> <?php endif; ?> |