roberton1973
Forum Replies Created
-
Yes sort of it. I want that in the filter, the members can always choose between Female and Male, If they put for example to search for female in the profile, in the beginning when they go on members there will be showed only female profile, but with the filter they should always be able to decide to change what they want to be showed and nothing selected, is meaning to show both the gender.
Hi.
I would like that the search for female or male is done from member directory and not set in the profile or alternatively, that would be possible to overwrite what choosen in the profile using the filter in member directory.
For example in the profile nothing is choosen and in that way will show both, then user go in member directory and choose whatever he/she wants.
Thanks and regards
- This reply was modified 2 years, 12 months ago by roberton1973.
Hi. thank You.
It does not seems to work for me.
When I go to member direcetroy, If choose that i search for a female, it displays only the persons searching for female profiles, instead to show all the women’s profile.
Insteat, if i Left only the code of Miss veronica, is filtering only because set in the user profile. For example, if in my profile i choose to see only women in member directory, it will. I would like to do the same, but directly from member directory, so user don’t need to have this field in the profile.
Thanks again
Hi.
Any news on about ho to filter from gender directly in member directory?
Thanks
Sorry! I saw now that is Working, but in a different way that i was expecting. I wase put it in the profile I am searching for and then now, with the last correction i noticed later that i can see only the woman! that is a cool feature too, that i will take. Thanks. But it’s possible to set it as filter? that was my original question, and maybe if it would possible to add “Searching for both” like 3rd option to both profile and filter would be top!
Thanks & Regards.
They are both set on
?ensko (Female)
Mu?ko (Male)Both in this exact order.
Gender is set as radio, while gender_search as Dropdown. Maybe there is the problem?
Thanks again. Sadly still not work.
I will put here again all the code with the LIKE correction:
add_filter('um_prepare_user_query_args', 'um_112521_search_for_male_or_female', 10, 2 ); function um_112521_search_for_male_or_female( $query_args, $args ){ $user_id = get_current_user_id(); um_fetch_user( $user_id ); $search_gender = um_user("gender_search"); $query_args['meta_query'][ ] = array( 'relation' => 'OR', array( 'key' => 'gender', 'value' => $search_gender, 'compare' => 'LIKE' ), ); return $query_args; }
Thanks so much for the time you tooked to try to solve my problem
Thanks also to You for your kind answe. Sadly the results don’t change. I always got the message that there are not members, even without filtering.
I think I am wrong something here:
$search_gender = um_user("gender_search"); $query_args['meta_query'][ ] = array( 'relation' => 'OR',
I tried also to put gender search in a single braket, but no results.
$search_gender = um_user('gender_search');
Thanks again
Hello.
Thank You for the answer.
So, if I put the code as You told me:
add_filter('um_prepare_user_query_args', 'um_112521_search_for_male_or_female', 10, 2 ); function um_112521_search_for_male_or_female( $query_args, $args ){ $user_id = get_current_user_id(); um_fetch_user( $user_id ); $search_gender = um_user("gender_search"); $query_args['meta_query'][ ] = array( 'relation' => 'OR', array( 'key' => 'gender', 'value' => '=', 'compare' => $search_gender ), ); return $query_args; }
I got not results at all. eve without filtering, is simply empty the page of the directory
Strangerly, ifi take your code without modificatrions, i can filter but whathever i do, i got as the result the same sex persons. Is like i see all the person searching for example i am on the oflline site for the tests where i registered me and my wife. I put to me “I search for female” and for her i search for male. If i search for a female, it’s exiting my profile, the same happeningwith my wife. If i put for her “i search for a male”, only her profile will appear. this happening only without changing nothing to yyour code.
if i change this line
$search_gender = um_user("search_for_male_or_female");
with:
$search_gender = um_user("gender_search");
Nothing at all appear.
I double checked th metakey name and the option. Everything is ok.
The only difference is that the gender field is a radio, while thegender_search is a dropdown.
Could be that?
- This reply was modified 3 years ago by roberton1973.
- This reply was modified 3 years ago by roberton1973.
- This reply was modified 3 years ago by roberton1973.
Hello.
Thank Yo so much, very kind of You ??
Thank You so much. It works now ??
Oh ok. The it is what I already done, but not a title. is simply empty. and then I have the name of the sign.
For example instead ot Have something like
Horoscope sign
Aries
I have only “Aries”
the shortcode i use is [um_user_zodiac] Maybe there is something more to add
You can use the UM Forms designer to add the shortcode to profile pages.
UM Forms designer – Fields Manager – Setup New Field – Shortcode.
Sorry, I don’t understand wha you meaning. What is “UM Forms designer”? is an extension of UM? If Yes, where i get It? I only have installed Ultimate Member and in the menu I have:
Dashboard, Settings forms, user roles and member directory. Thanks
Hi.
Thank You for you fast solution. The code basically work, just that if I put on the “Shortcode tool”, instead for example of a textbox, It gaves me a different name of what i gave in the shortcode title. It tell me simply “Test”, but i don’t know where it coming from that word, because is not in the code. If Is possible doing with the shortcode how to add also an icon beside the title?
If i try to put the shortcode in a simple text box, it appears only when i go to edit mode and confirm it, even if i set that must be viewed on both mode.
I tried different configuration, but nothing seem to change.
Thaaaaaaaaaaaaaaaaaaaaaanks! ?? It was that. now working great. Sorry to have annoyed You so much. Great Support like usual.