[Plugin: Author Image] Add text link to widget output
-
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>'; }
- The topic ‘[Plugin: Author Image] Add text link to widget output’ is closed to new replies.