How To Show
Show Latest Post or Item without any plugin. so follow this easy steps and show latest item.
code-
<?php // Define our WP Query Parameters $the_query = new WP_Query( 'posts_per_page=5' ); ?> <?php // Start our WP Query while ($the_query -> have_posts()) : $the_query -> the_post(); // Display the Post Title with Hyperlink ?> <div><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></div> <?php // Repeat the process and reset once it hits the limit endwhile; wp_reset_postdata(); ?>
Paste this code in your website’s theme, then show latest post anywhere when you paste this code.
Watch Video