Hi I am needing some help trying to add the recent post excerpt to the bottom left div of my webpage.
below is the piece of code that I'm having problems with in-between the p tags. I can display the post title and the ID, But cant get the recent post content or the recent post excerpt.
<!-- //start -->
<h2>Recent Post</h2>
<div class="recent-post-holder">
<div class="recent-image-holder"><img class="recent-image" src="images/feeding.jpg" alt=""></div>
<?php
$args = array( 'numberposts' => '1' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ) {
echo ' <div class="recent-text-holder"><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"]. '</a>
<p>' . get_the_excerpt(). '</p> </div> ';
} ?>
I just want to add the post content in-between the <p>
tags not sure were I'm going wrong iv tried the following in-between the p tags:
$recent[post_excerpt]
the_content()
I have been trying to find a solution to this I've looked through other similar post, But I cant get it to display the content. I was not sure if I need to create a while loop within the code to then return the post content, I'm not sure.
I am new to php and any help on this I would be grateful
Many thanks