I am also experiencing this issue.
The hook as stated in the FAQ is incorrect. Use woothemes_our_team_member_fields instead of woothemes_our_member_fields.
Thanks @maartenhemmes – your solution solved it for me 🙂
This is my code and it isn’t working 🙁
######### Functions.php #########
add_filter( 'woothemes_our_team_member_fields', 'my_new_fields' );
function my_new_fields( $fields ) {
$fields['misc'] = array(
'name' => __( 'Misc', 'our-team-by-woothemes' ),
'description' => __( '', 'our-team-by-woothemes' ),
'type' => 'text',
'default' => '',
'section' => 'info'
);
return $fields;
}
######### Frontend #########
add_filter( 'woothemes_our_member_fields_display', 'my_new_fields_display' );
function my_new_fields_display( $member_fields ) {
global $post;
if ( '' != $post->misc ) {
$member_fields .= '<li class="misc">' . $post->misc . '</li><!--/.misc-->' . "\n";
}
return $member_fields;
}
Anyone have any idea?
@yakup1981 Are both those code snippets from your functions.php file of your currently set theme?
@thorne51
The code snippets are seperated. The first part is a snippet from the functions.php. The second part is a snippet from a file within the currently selected theme.
I’m pretty new to WP but its working for me when both are in the functions.php. Not sure if its a matter of the code getting called too late, idk.
I’ll try your solution again…
@thorne51
Thank you for your help, it’s working now!
The problem was that i made a mistake by placing the code in two seperated files (functions.php and single.php).
You where right the could should be placed only in functions.php
I’m now trying to add the custom fields to the bio page.
Please how can I add more than one field.