Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pymarkley

    (@pymarkley)

    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;
              }
    Thread Starter pymarkley

    (@pymarkley)

    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=”https://schema.org/Person&#8221; 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;
    }

    `

Viewing 2 replies - 1 through 2 (of 2 total)