WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Author Image] Add text link to widget output (1 post)

  1. cogdog
    Member
    Posted 4 years ago #

    Plugin worked like a charm, perfect, exactly what I needed.

    I thought the link to the author page just on the photo was not enough, so I added a little bit of code (just repurposed what was there) in function widget right after the description ($desc) is output (set to not display if current context is author page):

    if ( $link and !is_author()) {
    	if ( !$always )
    		$author_link = get_author_posts_url($author_id);
    	elseif ( get_option('show_on_front') != 'page' || !get_option('page_on_front') )
    		$author_link = user_trailingslashit(get_option('home'));
    	elseif ( $post_id = get_option('page_for_posts') )
    		$author_link = apply_filters('the_permalink', get_permalink($post_id));
    	else
    		$author_link = user_trailingslashit(get_option('home'));
    
    	$author_name = $author_image = get_usermeta($author_id, 'display_name');
    
    	echo '<a href="' . esc_url($author_link) . '">See all posts by ' . $author_name . '</a>';
    }

    http://wordpress.org/extend/plugins/sem-author-image/

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by cogdog
  • This topic is not a support question
  • WordPress version: 3.0