-
Author
-
January 15, 2014 at 02:35 #9730
Leap-it
Participantis there a way to change the profil colors (background, buttons, text …….) depending on gender ?
thanks
January 16, 2014 at 19:18 #9810Abe
KeymasterHello,
This code added to sweetdate-child/functions.php will add a class to the body tag with the specific value of user, eq: man and after that you just need to add you CSS rules accordingly for each class eq. body.man #header {color: blue;}COPY CODE/* * Adds some required body claasses */ add_filter('body_class','kleo_body_my_classes'); /** * Adds specific classes to body element * @param array $classes * @return array * @since 2.1 */ function kleo_body_my_classes($classes = '') { global $bp; if (is_user_logged_in()) { $data = bp_get_profile_field_data( 'field=I am a&user_id=' . $bp->loggedin_user->id ); $classes[] = strtolower(str_replace(' ', '-', $data)); } return $classes; }
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.January 26, 2014 at 01:24 #10214whinds
ParticipantAlso how do i display another field above the the Age / City (ie man or woman, marrried or single)?
January 31, 2014 at 12:26 #10406Abe
KeymasterHi, Please see this topic for the fields that appear on that line
https://archived.seventhqueen.com/forums/topic/member-directory-page-about-me-text-does-not-displayHi 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.May 21, 2014 at 14:54 #18457Graphikom
ParticipantHello,
I’m sorry but I don’t andestand.
I add your code in function.php of sweetdare-child
Where I create the CSS Classes ? And how ? I’m sorry I’m a French newby 🙂THE CODE :
* Adds some required body claasses
*/
add_filter(‘body_class’,’kleo_body_my_classes’);/**
* Adds specific classes to body element
* @param array $classes
* @return array
* @since 2.1
*/
function kleo_body_my_classes($classes = ”) {
global $bp;
if (is_user_logged_in()) {
$data = bp_get_profile_field_data( ‘field=I am a&user_id=’ . $bp->loggedin_user->id );
$classes[] = strtolower(str_replace(‘ ‘, ‘-‘, $data));
}
return $classes;
}May 24, 2014 at 13:54 #18712Abe
KeymasterHi @Graphikom
You need basic PHP, HTML, CSS knowledge to make specific edits. That code will add some classes to the body tag depending on your profile values user saved for the “I am a” field.
Inspect elements in your browser with Chrome Inspect element toolHi 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
You must be logged in to reply to this topic.