How to link the image to the URL
-
I was looking to link the feature image to the URL like the title is and noticed others asked also. Following is the solution I implemented:
Open woothemes-our-team-template.php
Find the following code between lines 201 and 205:
if ( isset( $post->image ) && ( '' != $post->image ) && true == $args['display_avatar'] ) { $template = str_replace( '%%AVATAR%%', '<figure itemprop="image">' . $post->image . '</figure>', $template ); } else { $template = str_replace( '%%AVATAR%%', '', $template ); }
Replace with the following code:
if ( isset( $post->image ) && ( '' != $post->image ) && true == $args['display_avatar'] ) { if ( true == $args['display_url'] && '' != $post->url && apply_filters( 'woothemes_our_team_member_url', true ) ) { $template = str_replace( '%%AVATAR%%', '<figure itemprop="image">' . '<a href="' . esc_url( $post->url ) . '">' . $post->image . '</a>' . '</figure>', $template ); } $template = str_replace( '%%AVATAR%%', '<figure itemprop="image">' . $post->image . '</figure>', $template ); } else { $template = str_replace( '%%AVATAR%%', '', $template ); }
Save the file and replace in the plugin directory.
IMPORTANT NOTE: This plugin does not allow child theme template overrides at the moment so updating the plugin will result in losing your modification.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to link the image to the URL’ is closed to new replies.