Obtiene el nombre del autor de los mensajes fuera del bucle
Categorías: Diseño
14/02/2011 Última actualización:
14/02/2011: Mensajes Sun
Ahora ni siquiera escribir, así que no salió cuando usted busca, tentativamente como un recordatorio para sí mismo.
$author = get_userdata($post->post_author); echo $author->display_name;
the_author() や get_the_author() はWordPressループ中でないと効かないので、ループ外でユーザーデータを取得して表示する方法です。
場合によっては「global $post;」とかいるかも?です。
私はアーカイブページで表示したかったので、loop.phpに上記を書いてバッチリでした。
- タグ
- get_the_author() , the_author() , ループ外 , 投稿者名
- トラックバックURL




























