Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Joyn › Blog Author link to Archive?
New Landing › How can we help? › Themeforest Theme Support › Joyn › Blog Author link to Archive?
- This topic has 5 replies, 2 voices, and was last updated 10 years by Mohammad – SUPPORT.
-
Posted in: Joyn
-
December 24, 2014 at 1:46 am #137640
Hi guys
I’m hoping to find a way to make the Author box at the bottom of posts contain a link to that author’s posts archive. Preferably by making their avatar clickable.
Any pointers would be hugely appreciated ๐
Tommy
December 24, 2014 at 5:13 am #137657Hi,
Please enable Show author info through Post meta settings at post edit screen. Now you will get desire thing.You have to do one more thing. Just open to edit functions.php of your child theme and insert this php code:-
<?php function sf_post_info() { global $post, $sf_options; $author_info = sf_get_post_meta( $post->ID, 'sf_author_info', true ); $post_date = get_the_date(); $remove_dates = $sf_options['remove_dates']; if ( is_singular( 'directory' ) ) { $author_info = true; } $post_categories = get_the_category_list( ', ' ); ?> <?php if ( $author_info ) { ?> <div class="author-info-wrap clearfix"> <div class="author-avatar"><?php if ( function_exists( 'get_avatar' ) ) { ?> <a href="<?php echo site_url().'/author/'.get_the_author_meta( 'nice_name' );?>" ><?php echo get_avatar( get_the_author_meta( 'ID' ), '140' );?></a> <?php } ?></div> <div class="author-bio"> <div class="author-name" itemprop="author" itemscope itemtype="http://schema.org/Person"><h3 class="vcard author"><span itemprop="name" class="fn"><?php the_author_meta( 'display_name' ); ?></span> </h3></div> <div class="author-bio-text"> <?php the_author_meta( 'description' ); ?> </div> </div> </div> <?php } ?> <?php if ( $author_info ) { ?> <div class="post-info clearfix"> <?php } else { ?> <div class="post-info post-info-fw clearfix"> <?php } ?> <?php if ( !$remove_dates ) { ?> <div class="post-date"><?php echo $post_date; ?></div> <?php } ?> <?php if ( $post_categories ) { ?> <div class="categories-wrap"><?php _e( "Categories:", "swiftframework" ); ?><span class="categories"><?php echo $post_categories; ?></span> </div> <?php } ?> <?php if ( has_tag() ) { ?> <div class="tags-wrap"><?php _e( "Tags:", "swiftframework" ); ?><span class="tags"><?php the_tags( '' ); ?></span></div> <?php } ?> <div class="comments-likes"> <?php if ( comments_open() ) { ?> <div class="comments-wrapper"><a href="#comments" class="smooth-scroll-link"><i class="ss-chat"></i><span><?php comments_number( __( '0 Comments', 'swiftframework' ), __( '1 Comment', 'swiftframework' ), __( '% Comments', 'swiftframework' ) ); ?></span></a> </div> <?php } ?> <?php if ( function_exists( 'lip_love_it_link' ) ) { lip_love_it_link( get_the_ID(), true, 'text' ); } ?> </div> </div> <?php }?>
Thanks
MohammadDecember 24, 2014 at 8:28 am #137679Hi Mohammad
That almost worked ๐
It makes the avatar redirect to:
“site”/author (which shows a 404)
instead of
“site”/author/”username”I’m trying to understand the php code to see if there is a problem but I am a noob and really don’t understand.
Thanks for your help!!
December 24, 2014 at 9:00 am #137684Hi,
Please find this code:-get_the_author_meta( 'nice_name' ); Change to :- get_the_author_meta( 'user_nicename' );
Thanks
MohammadDecember 24, 2014 at 9:05 am #137685Thank you – Works perfectly.
Cheers
ThomasDecember 24, 2014 at 9:06 am #137686Hi,
You most welcome.
Thanks
Mohammad -
Posted in: Joyn
You must be logged in and have valid license to reply to this topic.