This repository was archived by the owner on May 18, 2025. It is now read-only.
Description Good morning,
I was trying to display contact_email with a custom template such as:
add_filter( 'woothemes_our_team_item_template', 'new_team_member_template' );
function new_team_member_template( $tpl ) {
$tpl = '<li itemscope itemtype="http://schema.org/Person" class="%%CLASS%%">%%AVATAR%% %%TITLE%% %%CONTACT_EMAIL%% <div id="team-member-%%ID%%" class="team-member-view-more" itemprop="description"><a href="%%PROFILE_URL%%" class="readProfile">Read more</a><div class="team-member-text">%%TEXT%%</div></div></li>';
return $tpl;
}
But CONTACT_EMAIL didn't work
So I tried to find out what was going wrong, and made the following change in whoothemes-our-team-template.php
line 174 I saw this:
if ( true == $args['contact_email'] && '' != $post->contact_email && apply_filters( 'woothemes_our_team_member_contact_email', true ) ) {
$member_fields .= '<li class="our-team-contact-email" itemprop="email"><a href="mailto:' . esc_html( $post->contact_email ) . '">' . __( 'Email ', 'our-team-by-woothemes' ) . get_the_title() . '</a></li>';
}
and changed it to this:
if ( true == $args['contact_email'] && '' != $post->contact_email && apply_filters( 'woothemes_our_team_member_contact_email', true ) ) {
$member_fields .= '<li class="our-team-contact-email" itemprop="email"><a href="mailto:' . esc_html( $post->contact_email ) . '">' . __( 'Email ', 'our-team-by-woothemes' ) . get_the_title() . '</a></li>';
$template = str_replace( '%%CONTACT_EMAIL%%', '<a href="mailto:'.esc_html( $post->contact_email ).'">'.esc_html( $post->contact_email ).'</a>', $template );
}
Now I can retrieve contact_email on my template, Is this the right way to change it or should it not be wrap around that if condition?
If this is ok is it worth to push these changes?
Reactions are currently unavailable
Good morning,
I was trying to display contact_email with a custom template such as:
But
CONTACT_EMAILdidn't workSo I tried to find out what was going wrong, and made the following change in
whoothemes-our-team-template.phpline 174 I saw this:
and changed it to this:
Now I can retrieve
contact_emailon my template, Is this the right way to change it or should it not be wrap around thatifcondition?If this is ok is it worth to push these changes?