This topic has 20 replies, 6 voices, and was last updated 10 years by Abe.

  • Author
  • #2756
     wattsjmw
    Participant

    I’m trying to add new custom fields I’ve added to my database into the member directory. When I add the code in this thread:

    https://archived.seventhqueen.com/forums/topic/member-directory-page-about-me-text-does-not-display

    into the child functions.php file, it breaks the site. Has there been an updated thread that addresses this?

    Thanks for all your great support.

    SOLUTION: https://archived.seventhqueen.com/forums/topic/add-fields-to-member-directory#reply-4861

    #2784
     SQadmin
    Keymaster

    Hi,
    Please try again with the code. I changed it since in your initial functions.php file there was a function prepared for you to make customizations and it was interfering with this code. Now it should be fine

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2790
     wattsjmw
    Participant

    Thanks. This code works to add fields that are in the standard theme, but not fields that I’ve added. Is there any way to add a field that I’ve added to the xprofile_fields table?

    #2809
     SQadmin
    Keymaster

    Yes, Just rename those to match your names.
    Also you can add more by adding a coma after the last one and writing them just like the existing ones

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2814
     wattsjmw
    Participant

    Hi, thanks so much. I tried adding the names of the fields, but nothing is returned.

    Maybe I missed a step in adding custom fields–I just added the directly to the wp_bp_xprofile_fields table in the database.

    Do I also need to add them within a function?

    #2851
     SQadmin
    Keymaster

    Profile fields are normally added trom WP admin -> Users -> Profile fields. If you added from database and they appear there then it should be fine.
    In order for a field to appear a members has to complete the info for it.
    Put a sample of the code added if it still doesn’t work

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #3387
     mylaiva
    Participant

    it isn’t working for me either. This is the code I have:
    add_action(‘after_setup_theme’,’ kleo_my_member_data’);
    function kleo_my_member_data()
    {
    global $kleo_config;
    //this is the details field, right now it take the “About me” field content
    $kleo_config[‘bp_members_details_field’] = ‘About me’;
    //this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
    $kleo_config[‘bp_members_loop_meta’] = array(
    ‘I am’,
    ‘Type’,
    ‘City’
    );

    }

    I also have this code in another section:
    function kleo_remove_actions()
    {
    add_filter(‘kleo_bp_meta_fields’,’my_remove_age’);

    /* For example uncomment the line bellow to disable matching on member profile */
    //remove_action(‘kleo_bp_before_profile_name’, ‘kleo_bp_compatibility_match’);
    }

    function my_remove_age($output) {
    //remove the Age form array
    unset($output[‘age’]);

    return $output;
    }

    #3401
     SQadmin
    Keymaster

    Hi, Do you have the sweetdate-child theme activated?
    Users must fill that information in their profile.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #3452
     mylaiva
    Participant

    Yes, it’s activated and those fields are filled out.

    #3551
     SQadmin
    Keymaster

    Hi, From the pasted code this are the exact field names that should exist:
    ‘I am’,
    ‘Type’,
    ‘City’,
    ‘About me’

    Give us a link to your site to take a look

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #4796
     notime
    Participant

    Having the same issue, code dont work

    #4801
     notime
    Participant

    Is this calling the correct section?

    add_action(‘after_setup_theme’,’ kleo_my_member_data’);
    function kleo_my_member_data()

    Because if I edit the MAIN functions.php the changes work, however if I edit the child theme one, with the full code, it does not work.

    #4861
     SQadmin
    Keymaster

    This is the code that should be added, with you changes on the field names:

    COPY CODE
    
    
    add_action('after_setup_theme',' kleo_my_member_data');
    function kleo_my_member_data()
    {
    	global $kleo_config;
    	//this is the details field, right now it take the “About me” field content
    	$kleo_config['bp_members_details_field'] = 'About me';
    	//this display the fields under the name, eq: 36 / Woman / Divorced / Berlin. Modify with the names of the fields you want to appear there
    	$kleo_config['bp_members_loop_meta'] = array(
    	'I am',
    	'Type',
    	'City'
    	);
    } 
    

    Because it does a caching on those fields you can add this also to sweetdate-child/functions.php and remove it once the new fields appear:

    COPY CODE
    
    delete_transient( 'kleo_bp_meta_fields');
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #11283
     FD
    Participant

    Hi,

    When editing the similar code in the sweetdate/functions.php it worked, but when adding the code above to sweedate-child/functions.php i does not work. Any idea what´s wrong?

    And yes, I changed the fields to match my own. 🙂

    #11393
     Abe
    Keymaster

    If it works in the parent theme then maybe the child theme is not active

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #11419
     FD
    Participant

    The child theme is activated.

    Attached a screen dump of it for verification. 🙂

    https://dl.dropboxusercontent.com/u/11195235/fd/child-theme-active.png

    Any idea what´s happening?

    #11568
     Abe
    Keymaster

    Strange 🙂
    You are doing something wrong for sure. Maybe you are missing a line or something

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #11592
     FD
    Participant
    This reply has been set as private.
    #11834
     Abe
    Keymaster

    Make sure you don;t have a same function added to the main theme when you put it in sweetdate-child/functions.php

    It is definitely something related to your added code

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #11901
     FD
    Participant
    This reply has been set as private.
    #12261
     Abe
    Keymaster

    Hi That indeed is not related. Can’t say what could cause this. Leave it there and remember to put it on a new update back to the file. Sorry …

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 21 posts - 1 through 21 (of 21 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?