Get Recent Posts with shortcode
-
Hello All,
I am trying to display latest posts using wp_get_recent_posts function, in one of the post i have used a shortcode [newsletter] but instead of diaplying the content of shortcode, this itself is got printed [newsletter] my code is this
`$args = array(
‘numberposts’ => 2,
);$recent_posts = wp_get_recent_posts($args);
foreach( $recent_posts as $recent ){
echo ‘<li><span class=”header”><a href=”‘ . get_permalink($recent[“ID”]) . ‘” title=”Look ‘.esc_attr($recent[“post_title”]).'” >’ . $recent[“post_title”].'</a></span> ‘. $recent[‘post_content’].'</li> ‘;
}`
Please Help me out
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Get Recent Posts with shortcode’ is closed to new replies.