feature post
Coding Tips PHP WordPress

How to Create Breaking Post with feature image on WordPress Site Code Example:

WordPress is a free and open-source content management system written in PHP and paired with a MySQL or MariaDB database.

<?php
$recent_posts = wp_get_recent_posts(array(
‘numberposts’ => 2, // Number of recent posts thumbnails to display
‘post_status’ => ‘publish’ // Show only the published posts
));
foreach($recent_posts as $post) : ?>

<center> <a href=”<?php echo get_permalink($post[‘ID’]) ?>”>
<h2 class=”entry-title”><?php echo $post[‘post_title’] ?></h2>
<?php echo get_the_post_thumbnail($post[‘ID’], ‘full’); ?>

</a></center>

<?php endforeach; wp_reset_query(); ?>

output

output

5 Replies to “How to Create Breaking Post with feature image on WordPress Site Code Example:

  1. Excellent post. I was checking constantly this
    blog and I am impressed! Extremely helpful information specifically
    the last part 🙂 I care for such info much. I was looking for this particular information for
    a very long time. Thank you and good luck.

  2. Your style is so unique compared to other folks I’ve read stuff from.
    I appreciate you for posting when you’ve got the opportunity,
    Guess I will just bookmark this blog.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.