Re: Display latest post from WP
Yup, I know that; I just meant that you could quite simply add it to the arguments you took and it’d be a nice addition. My modified code at the end.
Yeah, it’s mildly annoying that the permalinks aren’t used, but it’s not a killer for me. I’d rather have this functionality than none. Thanks again for the plugin.
function wp_show_posts( $args ) {
global $bb;
parse_str($args, $r);
if ( !isset( $r['before'] ) )
$r['before'] = "<li>n";
if ( !isset( $r['after'] ) )
$r['after'] = "<br />n</li>n";
$posts = wp_get_posts( $args );
foreach( $posts as $post ) {
echo $r['before'];
echo "<a href='".$bb->wp_home."?p=".$post->ID."'>";
echo $post->post_title;
echo "</a>";
echo $r['after'];
}
}