質問

現在のユーザーのカスタムフィールドを取得したい場合は、このようなものを使用します。

<?php echo get_user_meta($user_info->ID,'address_line_2',true);?>

しかし今回は著者が欲しいので、以下の複数のバージョンを試してみました。

<?php 
$thisauthorID = get_the_author_ID();

echo get_the_author_meta($thisauthorID,'address',true)
        ;?>

何か案は?

素晴らしい

役に立ちましたか?

解決

get_the_author_meta() != get_user_meta().
への変更:
echo get_the_author_meta('address', $thisauthorID);

ライセンス: CC-BY-SA帰属
所属していません wordpress.stackexchange
scroll top