我已经检查了代码。您的代码中存在一些问题:
没有任何方法“coauthors\\u posts\\u links”,但WordPress提供了一种方法the_author_posts_link();.对于“get\\u the\\u post\\u thumbnail()”函数,第二个参数必须是图像大小,如
$thumb = get_the_post_thumbnail($post, \'thumbnail\',array(\'class\' => \'front-page-tease-sm\'));
我已经更新了代码。对于“coauthors\\u posts\\u links()”不知道您想在这里做什么?
$cat = get_queried_object();
$posts = get_posts(array(\'posts_per_page\' => 15, \'offset\' => 0, \'category\' => 1));
foreach($posts as $post)
{
$postID = $post->ID;
$title = get_the_title($postID);
$link = get_permalink($postID);
$date = get_the_date(\'M. j, Y\', $postID);
$authors = \'\';
$excerpt = get_the_excerpt($postID);
$thumb = get_the_post_thumbnail($post, \'thumbnail\',array(\'class\' => \'front-page-tease-sm\'));
echo \'\';
// Left box - date
printf(\'%1$s\', esc_attr($date));
// Middle box flex - headline, author, and excerpt
echo \'\';
printf(\'%2$s\', esc_attr($link), esc_html($title));
printf(\'By %1$s\', $authors);
printf(\'%1$s\', $excerpt);
echo \'\';
// Right box - thumbnail
printf($thumb);
echo \'\';
}