I need to display 2 articles on a custom template page on a Wordpress blog, but this code shows nothing.
$myposts = get_posts("numberposts=2&category=3");
foreach($myposts as $post) : the_content(); endforeach;
but if I try print_r($myposts);, I can say that there is an array. How can I solve this problem? many thanks
source
share