我为随机帖子链接编写了简单的片段:
function ex_get_random_post_link ()
{
$args = array(
'posts_per_page' => 1,
'ignore_sticky_posts' => true,
'post_type' => 'post',
'orderby' => 'rand'
);
$query = new WP_Query($args);
$query->the_post();
return get_permalink();
}
但我只想发布没有帖子格式的帖子。