ログインしたユーザーに対して、デフォルトの My Account という単語の代わりに表示したい ユーザーの名前を表示したいのですが、このコードを試してみましたが、何も表示されません!
次の場所にあるファイルの変数を認識していないようです$current_user
: wp-content/themes/themeName/framework/functions/woo-account.php
printf( __( '%s', 'wpdance' ),$current_user->user_lastname);
そうだった:
printf( __( 'My Account', 'wpdance' ));
また、このコードを使用してすべてのものを取得しようとしました:
<?php global $current_user;
get_currentuserinfo();
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User email: ' . $current_user->user_email . "\n";
echo 'User level: ' . $current_user->user_level . "\n";
echo 'User first name: ' . $current_user->user_firstname . "\n";
echo 'User last name: ' . $current_user->user_lastname . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
echo 'User ID: ' . $current_user->ID . "\n";
?>
しかしUser first name:
、User last name:
空でした!
誰か提案やアイデアはありますか?
よろしくお願いします!