现在,我正在使用下面的代码显示自定义帖子类别中最近帖子的标题及其链接,但对于我的一个类别,我想显示摘录,我如何才能做到这一点。
我用于显示标题的代码:
<?php
$recent_posts = wp_get_recent_posts(array(\'post_type\'=>\'jokes\'));
foreach( $recent_posts as $recent ){
echo \'<li><a href="\' . get_permalink($recent["ID"]) . \'" title="Look \'.esc_attr($recent["post_title"]).\'" >\' . $recent["post_title"].\'</a> </li> \';
}
?>