こんにちは。ユーザさんからwp_recent_posts.php にニックネームを出せない?といわれて、見よう見まねで下記のようにしてみました。 $post_title = stripslashes($lpost->post_title); if (trim($post_title)=="") $post_title = _WP_POST_NOTITLE; $author_nicname = stripslashes($lpost->post_author);//apap modify if (trim($author_nicname)=="")//apap modify $author_nicname = "blog name no";//apap modify $permalink = get_permalink($lpost->ID); $output .= '<li><span class="post-title"><a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . $post_title .$author_nicname . '" style="display: inline;">' . $post_title . '</a></span>'.$newstr.'</li>'; 結果リストのtitle(Permanent Link:xxxx)にユーザ番号を含めるところまでは、なんとか でも、ニクネームって xxxxx_wp_users にあるんですね。user_nickname(うちでは、これをユーザ毎のブログ名にしているので)を表示してやるのは、ながーいコードがいりますか?・・・余計なDBアクセスになってしまうのかなぁ。
$post_title = stripslashes($lpost->post_title); if (trim($post_title)=="") $post_title = _WP_POST_NOTITLE; $author_nicname = stripslashes($lpost->post_author);//apap modify if (trim($author_nicname)=="")//apap modify $author_nicname = "blog name no";//apap modify $permalink = get_permalink($lpost->ID); $output .= '<li><span class="post-title"><a href="' . $permalink . '" rel="bookmark" title="Permanent Link: ' . $post_title .$author_nicname . '" style="display: inline;">' . $post_title . '</a></span>'.$newstr.'</li>';
get_author_nameという関数が用意されていますので、 $author_nicname = get_author_name($lpost->post_author, 'nickname'); で取得できると思います。
$author_nicname = get_author_name($lpost->post_author, 'nickname');
そんな便利なものが用意されていたのですね ありがとうございますです!
このプログラムは KENT 氏の yybbs を xoops(PHP) に移植したものです - KENT -