巫冰吧 关注:13贴子:384
  • 0回复贴,共1

wordpress通过指定文章ID调出文章标题代码!

只看楼主收藏回复

<?php $post_id = 2408;
$postArray = get_post($post_id, ARRAY_A);
$title = $postArray['post_title'];
$url = $postArray['guid'];
echo "<a href=" . $url. ">" .$title. "</a>" ;
?>
2048是文章ID


1楼2017-12-26 13:55回复