-
<?php
global $userpro;
?>permalink( get_the_author_meta(‘ID’) ); ?>”><?php echo the_author();?>
</div>When I try and delete one section. It deletes it all 🙁
Ahmed can you show me how I can add a user avatar and link to profile with this code;
<?php
global $userpro; if ( function_exists( ‘coauthors_posts_links’ ) ) {
coauthors_posts_links();
} else {
the_author_posts_link();
}
?>echo the_author(); will double post author link because the author function already has echo in it. double echo! 🙂
You can show user avatar only if you knew author ID, e.g.
get_avatar(get_the_author_meta(‘ID’), $size=50);
I’ve got everything working. It’s just the hyperlinks aren’t
<?php foreach( get_coauthors() as $coauthor ) : ?>
<div id=”authorinfo” class=”userpro-profile-img-after”>
userpro_author_url; ?>”><?php echo get_avatar( $coauthor->user_email, ’80’ ); ?>
<p class=”marB10″><?php _e(‘By’, ‘contempo’); ?>: permalink($user_id); ?>”><?php echo $coauthor->display_name; ?></p>
<div class=”clear”></div>
</div>
<?php endforeach; ?>
</div>Wow, what do you want to have as a hyper link? The code looks broken to me, I can’t see what are you trying to do
I’m trying to hyperlink to user profile pages instead of author pages ; however when I added the link , it just goes to /profile instead of profile/username
<?php foreach( get_coauthors() as $coauthor ) : ?>
<div id=”authorinfo” class=”userpro-profile-img-after”
?php echo $coauthor->userpro_author_url; ?>”><?php echo get_avatar( $coauthor->user_email, ’80’ ); ?>
<h5 class=”marB10″><?php _e(‘By’, ‘contempo’); ?>: =”<?php echo $userpro->permalink($user_id); ?>”><?php echo $coauthor->display_name; ?>
<div class=”clear”></div>
</div>
<?php endforeach; ?>
</div>I’ve taken out the href hyperlinks.
I’m trying to do this ;
By Author ( link to userpro profile )
I’m using a coauthor plugin to display more than one author though.
Try $userpro->permalink( $coauthor->ID ); to show profile link for coauthor? 🙂
Hey Ahmed,
Wonder if you can help me figure out where how to hyperlink the author link to their profile.
It currently links to get_author_urlif ($single_author && !$remove_dates) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘%1$s’, ‘swiftframework’), $post_date) .'</div>’;
} else if (!$remove_dates) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘By %1$s on %3$s’, ‘swiftframework’), $post_author, get_author_posts_url(get_the_author_meta( ‘ID’ )), $post_date) .'</div>’;
} else if (!$single_author) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘By %1$s‘, ‘swiftframework’), $post_author, get_author_posts_url(get_the_author_meta( ‘ID’ ))) .'</div>’;What’s the dynamic ID in that code for author? you can do : ‘permalink( get_the_author_meta(‘ID’) ).'”>Profile
Can you send that code in an email, as it keeps on hyperlinking.
I want to make the link go to user profile, and not user website url.
So I’m wanting to add this code…
<?php foreach( get_coauthors() as $coauthor ) : ?>
<div id=”authorinfo” class=”columns alpha omega marT30 marB20″>
permalink( $coauthor->ID ); ?>”><?php echo get_avatar( $coauthor->user_email, ’80’ ); ?>
<h5 class=”marB10″>permalink( $coauthor->ID ); ?>”><?php echo $coauthor->display_name; ?></h5>
<div class=”clear”></div>
</div>
<?php endforeach; ?>to this ….
if ($show_details == “yes” && $post_format != “quote” && $post_format != “link”) {
if ($single_author && !$remove_dates) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘%1$s’, ‘swiftframework’), $post_date) .'</div>’;
} else if (!$remove_dates) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘%1$s on %3$s’, ‘swiftframework’), $post_author, get_author_posts_url(get_the_author_meta( ‘ID’ )), $post_date) .'</div>’;
} else if (!$single_author) {
$post_item .= ‘<div class=”blog-item-details”>’. sprintf(__(‘%1$s‘, ‘swiftframework’), $post_author, get_author_posts_url(get_the_author_meta( ‘ID’ ))) .'</div>’;
}
}
You must be logged in to reply to this topic.