サポート » 使い方全般 » ユーザー情報の表示について

  • はじめまして。
    いろいろ調べてみたのですが解決方法が見つからず質問させていただきます。よろしくお願いします。

    マルチサイトで複数のブログ(A、B、C)を制作をしています。
    一つのブログには何人かの投稿者がいて、
    たとえば、AのブログにはAの登録者だけの情報をAのトップページに一覧表示させたいです。

    とりあえず、sidebar.phpに下記のように書いたのですが、

    <div class="profileImage">
    <?php if ( function_exists( 'ps_user_profile_image' ) ) {
        ps_user_profile_image( 5, 'standard' );
    } ?>
    </div>
    <div class="MG-B5"><strong>名前:</strong><?php the_author_meta('last_name', '5'); ?> <?php the_author_meta('first_name', '5'); ?></div>
    <div><strong>自己紹介</strong></div>
    <div style="padding-bottom:30px;"><?php the_author_meta('user_description', '5'); ?></div>

    これですと、ユーザーごとにIDを書き換えなければいけないので、
    自動でIDを取得するためにはループの中に書けばいいかと思い、下記のようにしたのですが、
    投稿記事の分だけ表示され、ダブって登録者が表示されてしまいます。。

    <?php if(have_posts()):?>
    <?php while(have_posts()): the_post();?>
    
    <div class="profileImage">
    <?php if ( function_exists( 'ps_user_profile_image' ) ) {
        ps_user_profile_image( get_the_author_meta('ID'), 'big' );
    } ?>
    </div>
    <div class="MG-B5"><strong>名前:</strong><?php the_author_lastname(); ?> <?php the_author_firstname(); ?></div>
    <div><strong>自己紹介</strong></div>
    <div style="padding-bottom:30px;"><?php the_author_description(); ?></div>
    
    <?php endwhile;?>
    <?php endif;?>

    なにかよいアドバイスをいただけたらうれしいです。
    よろしくお願いいたします。

  • トピック「ユーザー情報の表示について」には新たに返信することはできません。