WordPress.org

Forums

Our Team by WooThemes
Adding new custom field doesn't work (11 posts)

  1. malyo
    Member
    Posted 1 year ago #

    Hello,

    First of all I'd like to say that this plugin is really great, thanks for puting your effort into it.

    To the problem: I followed the guide in FAQ, adding the sample code to the functions.php inside my template dir (filter that hides field works btw), but it simply doesn't add any field to Add/Edit Team Member in WP-Admin.

    I'm clueless what to do now.

    http://wordpress.org/plugins/our-team-by-woothemes/

  2. mitchgk
    Member
    Posted 1 year ago #

    I am also experiencing this issue.

  3. maartenhemmes
    Member
    Posted 1 year ago #

    The hook as stated in the FAQ is incorrect. Use woothemes_our_team_member_fields instead of woothemes_our_member_fields.

  4. andreajbradley
    Member
    Posted 1 year ago #

    Thanks @maartenhemmes - your solution solved it for me :-)

  5. yakup1981
    Member
    Posted 1 year ago #

    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?

  6. thorne51
    Member
    Posted 1 year ago #

    @yakup1981 Are both those code snippets from your functions.php file of your currently set theme?

  7. yakup1981
    Member
    Posted 1 year ago #

    @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.

  8. thorne51
    Member
    Posted 1 year ago #

    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.

  9. yakup1981
    Member
    Posted 1 year ago #

    I'll try your solution again...

  10. yakup1981
    Member
    Posted 1 year ago #

    @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.

  11. yourme
    Member
    Posted 1 year ago #

    Please how can I add more than one field.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Our Team by WooThemes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic