Hey, you can use get_post_meta to grab your custom data. There’s an example of this in the FAQ.
Take a look at the “I need to add another field, can I do it without touching core files?” section and make sure you followed each step 🙂
Thanks for the reply. I have my function as such.
add_filter( 'woothemes_our_member_fields_display', 'my_new_fields_display' );
function my_new_fields_display( $member_fields ) {
global $post;
$expertise = esc_attr( get_post_meta( $post->ID, '_expertise', true ) );
if ( '' != $expertise ) {
$member_fields .= '<li class="expertise">' . $expertise . '</li><!--/.expertise-->' . "\n";
}
return $member_fields;
}
I put <?php echo $expertise; ?> in my tpl string and nothing is displayed. Only the %%-%% entries. Here is my template function.
function new_team_member_template( $tpl ) {
$tpl = ‘ <div itemscope itemtype=”http://schema.org/Person” class=”%%CLASS%%”>
<div class=”flip-container” ontouchstart=”this.classList.toggle(\’hover\’);”>
<div class=”flipper”>
<div class=”front”>
%%AVATAR%% %%TITLE%%
<div id=”team-member-%%ID%%” class=”team-member-infoicon” itemprop=”description”>
<img class=”infoicon” src=”/wp-content/uploads/2014/04/i-logo.jpg”>
</div>
</div>
<div class=”back”>
%%TITLE%% <div class=”team-info”>EXPERTISE: <?php echo $expertise; ?> <P>CONNECT: <P>VCARD: </div>
<img class=”team-learn-more” src=”/wp-content/uploads/2014/04/learnmorel-button.jpg”>
<div id=”team-member-%%ID%%” class=”team-member-infoicon” itemprop=”description”>
<img class=”infoicon” src=”/wp-content/uploads/2014/04/i-logo.jpg”>
</div>
</div>
</div>
</div>
</div>’;
return $tpl;
}
`
I also have the custom field function as well. That all is working and I can add info to the field in the admin area.
// Add Custom Fields to team member page
add_filter( 'woothemes_our_team_member_fields', 'my_new_fields' );
function my_new_fields( $fields ) {
$fields['expertise'] = array(
'name' => __( 'Expertise', 'our-team-by-woothemes' ),
'description' => __( 'Expertise Info', 'our-team-by-woothemes' ),
'type' => 'text',
'default' => '',
'section' => 'info'
);
return $fields;
}
Sorry, I’m afraid I can’t do this for you. Please copy paste the code exactly as it appears in the FAQ then change it one step at a time to see where you’re going wrong.