Support

Account

Home Forums General Issues User Field (Relational) Reply To: User Field (Relational)

  • thanks john,

    this is super-useful, and as you can see here i’ve managed to pull what i need and style it accordingly as a result – for the record here’s the code that worked for me:

    <div class="infoauthorimg">
      <?php 
        $users = get_sub_field('author');
        echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 120 ) );
    ?>
    </div>	
    <div class="infoauthorcopy">	
      <?php $users = get_sub_field('author'); ?>
      <h4><a href="#"><?php echo the_author_meta( 'display_name' ); ?></a></h4>
      <p class="nopad"><a href="<?php echo the_author_meta( 'user_url' ); ?>" target="_blank"><?php echo the_author_meta( 'user_url' ); ?></a></p>
      <p><a href="http://twitter.com/<?php echo the_author_meta( 'twitter' ); ?>" target="_blank">@<?php echo the_author_meta( 'twitter' ); ?></a></p>
      <p><?php echo the_author_meta( 'description' ); ?></p>	
    </div>

    so there are a couple of details which are a little beyond me – as you can see i’ve got a blank hyperlink there around the display_name – i’d like to be grabbing that author’s post archive url for there but it doesn’t seem to be in the array (see screenshot).

    i’d also really like to add some conditionals to the user_url and twitter data, so that they aren’t called as blank spaces if they don’t exist.

    any ideas on how i can fine tune this now?

    thanks so much – amazingly helpful as usual!

    m