我在这里有一个博客/www.mysite.com/section/news/ 只显示特定类别的新闻。当我使用wp_get_recent_posts() 和get_permalink($recent["ID"]) 链接位于此处/www.mysite.com/the-post-title/
<?php
$args = array(
\'numberposts\' => 2,
\'category\' => 14 );
$recent_posts = wp_get_recent_posts($args);
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> \';
}
?>
如何将链接指向/www.mysite.com/section/news/the-post-title/谢谢,非常感谢您的帮助。
当做