• Resolved lance1572

    (@lance1572)


    Man…it should be so easy but I cant seem to figure out. I’ve got something like this on my author page. thanks to another user here for the code up top. Sorry cant remember the name but thanks!

    I just want to perform a check to see if the author/coauthor has either a gravatar or a description set, if not echo out nothing. When there isn’t a gravatar, the divs still remain – so positioning is mucked…

    Seems like this should be so easy. I’ve spent hours looking through the plugin code but really cant seem to figure out what to do. What conditional arguments should be there…Please! Anyone with any advice, I would really appreciate it!

    
    <?php
        	global $coauthors_plus;
    			if (isset($coauthors_plus)) {
    				$curauth = $coauthors_plus->get_coauthor_by( 'user_nicename', $author_name );
    			} else {
       			if(isset($_GET['author_name'])) :
          			$curauth = get_userdatabylogin($author_name);
          		else :
          			$curauth = get_userdata(intval($author));
      			endif;
    			}
    
        ?>
    
        <article class="author-content">
            <div class="author-entry-intro">
                <?php echo coauthors_get_avatar( $curauth, 170 ); ?>
                <div class="author-details"><h2><?php echo $curauth->display_name; ?></h2>
                    <p><?php echo $curauth->description;?></p>
                </div>
            </div>
    
    
    • This topic was modified 7 years, 3 months ago by lance1572.
Viewing 1 replies (of 1 total)
  • Thread Starter lance1572

    (@lance1572)

    This seemed to have worked…luck i guess 🙂

    
        <?php if (has_post_thumbnail( $curauth->ID ) ):?>
                <?php echo coauthors_get_avatar( $curauth, 170 ); ?>
            <?php endif; ?>
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Simple check to see if user has a gravatar or description’ is closed to new replies.