latest posts shortcode with image
Image fix You are using the incorrect function to return the image source url. Change the_post_thumbnail_url( $post[“ID”] ) to get_the_post_thumbnail_url( $post[“ID”] ) see https://developer.wordpress.org/reference/functions/get_the_post_thumbnail_url/ To fix the echo Use a $return variable like so: $out=”<div class=”recent-posts”>”; $out .= ‘<h1>’.$content.'</h1>’; foreach($recent_posts as $post){ $out .= ‘<div class=”updated”><p>’ . $post[‘post_title’] . ‘.<a href=”‘ . get_permalink($post[‘ID’]) . ‘”>’; … Read more