• Ria

    (@lifeinbigtent)


    Hi,
    I would like to add to “Published by” section active link to separate page. I was reading all previous suggestions, but what I see in my “author-bio” page is nothing common with other:(

    <?php
    /**
     * The template for displaying Author bios
     *
     * @package WordPress
     * @subpackage Twenty_Fifteen
     * @since Twenty Fifteen 1.0
     */
    ?>
    
    <div class="author-info">
    	<h2 class="author-heading"><?php _e( 'Published by', 'twentyfifteen' ); ?></h2>
    	<div class="author-avatar">
    		<?php
    		/**
    		 * Filter the author bio avatar size.
    		 *
    		 * @since Twenty Fifteen 1.0
    		 *
    		 * @param int $size The avatar height and width size in pixels.
    		 */
    		$author_bio_avatar_size = apply_filters( 'twentyfifteen_author_bio_avatar_size', 56 );
    
    		echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
    		?>
    	</div><!-- .author-avatar -->
    
    	<div class="author-description">
    		<h3 class="author-title"><?php echo get_the_author(); ?></h3>
    
    		<p class="author-bio">
    			<?php the_author_meta( 'description' ); ?>
    			<a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
    				<?php printf( __( 'View all posts by %s', 'twentyfifteen' ), get_the_author() ); ?>
    			</a>
    		</p><!-- .author-bio -->
    
    	</div><!-- .author-description -->
    </div><!-- .author-info -->

    In which part and what I should add to have active link under “Published by” text. For example one of the posts (in the end is “Published by”) https://lifeinbigtent.com/good-manners-in-indonesia/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Lifeinbigtent
    Look & see this line
    <h2 class="author-heading"><?php _e( 'Published by', 'twentyfifteen' ); ?></h2>

    Let add home page URL on “Published by” this text

    <h2 class="author-heading">
         <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
             <?php _e( 'Published by', 'twentyfifteen' ); ?>
        </a>
    </h2>

    If you use this code and click this “Published by” this will go your home page way you can add like on you “Published by” text section like current post link or your own create page etc.

    Let me know if you have any query

    Thanks
    Musa

    Thread Starter Ria

    (@lifeinbigtent)

    Hi, sorry for late reply (was on the trip:))
    Thank you for suggestion, but it didn’t work:(

    I put the link in this part ( home_url( ‘/’ ) )

    ( https://lifeinbigtent.com/how-i-can-help-you/( ‘/’ ) )

    but instead of changes the all box under the posts “Published by” disappeared:(
    maybe I misunderstood something?
    Thank you:)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Author-bio add the active link’ is closed to new replies.