-
Author
-
September 13, 2013 at 03:58 #2756wattsjmwParticipant
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
September 13, 2013 at 21:51 #2784SQadminKeymasterHi,
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 fineHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 13, 2013 at 22:30 #2790wattsjmwParticipantThanks. 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?
September 13, 2013 at 23:57 #2809SQadminKeymasterYes, 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 onesHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 14, 2013 at 00:57 #2814wattsjmwParticipantHi, 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?
September 15, 2013 at 20:53 #2851SQadminKeymasterProfile 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 workHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionSeptember 26, 2013 at 23:43 #3387mylaivaParticipantit 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;
}September 27, 2013 at 02:02 #3401SQadminKeymasterHi, 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 solutionSeptember 27, 2013 at 20:59 #3452mylaivaParticipantYes, it’s activated and those fields are filled out.
September 30, 2013 at 03:10 #3551SQadminKeymasterHi, 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 solutionOctober 21, 2013 at 21:40 #4801notimeParticipantIs 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.
October 22, 2013 at 02:19 #4861SQadminKeymasterThis is the code that should be added, with you changes on the field names:
COPY CODEadd_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 CODEdelete_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 solutionFebruary 22, 2014 at 02:56 #11283FDParticipantHi,
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. 🙂
February 25, 2014 at 01:33 #11393AbeKeymasterIf 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.February 25, 2014 at 10:25 #11419FDParticipantThe 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?
February 27, 2014 at 15:42 #11568AbeKeymasterStrange 🙂
You are doing something wrong for sure. Maybe you are missing a line or somethingHi 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.March 4, 2014 at 14:02 #11834AbeKeymasterMake 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.March 7, 2014 at 22:37 #12261AbeKeymasterHi 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. -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.