Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Compatible Plugins › BuddyPress › Country, city list for search.
- This topic has 5 replies, 2 voices, and was last updated 6 years, 6 months ago by
Themosaurus.
-
AuthorPosts
-
Maks RusakovičParticipant@wegosi
- 29 Topics
- 104 Posts
The main function of country/city combination should be implemented.
BP xProfile Location is not working, because user can use different languages, for examples.
Ajax country/field will be great.
It could be great to connect country/city list from Facebook, for example. or https://vk.com/dev/database.getCities
September 7, 2018 at 13:51 #2005@themosaurus- 1 Topics
- 1675 Posts
Hi @wegosi,
Thank you for your feedback! ?
Gwangi is providing default XProfile fields for the City and the Country. For instance, their values are displayed on the cards shown on the members directory page. But those could be easily replaced by other values.
When you write that BP XProfile is not working, do you mean that the plugin isn’t fully integrated with Gwangi? And do you wish to display the field value on member cards and profiles?
Thank you for your reply.
Best,
September 10, 2018 at 12:48 #2035Maks RusakovičParticipant@wegosi- 29 Topics
- 104 Posts
Hello @themosaurus
I mean, BP xProfile Location is not working.
It’s just fill the country/city field.
But if the user uses different city names in different languages – search is not working.September 11, 2018 at 20:15 #2079@themosaurus- 1 Topics
- 1675 Posts
Hi @wegosi,
We’ve been looking for a solution to the issue with BP xProfile Location. This will be fixed in a coming release.
In the meantime, if you wish to use this plugin and display the value for your Location field instead of City and Country field values, please read the following topic:bug? missing location text on member profile card and header
In summary, you can display the BP xProfile Location field value by adding the following code snippet to your website:
if ( ! function_exists( 'gwangi_buddypress_member_location' ) ) : /** * Print the HTML for the BP xProfile Location field. * * @since 1.0.0 */ function gwangi_buddypress_member_location() { if ( function_exists( 'xprofile_get_field_data' ) ) : $location = xprofile_get_field_data( 'Location', bp_get_member_user_id() ); $allowed_html = array( 'a' => array( 'href' => array(), 'rel' => array(), ), ); if ( ! empty( $location ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-location"><?php echo wp_kses( $location, $allowed_html ); ?></div> <?php endif; endif; } endif;
To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
We hope this will solve your issue. ?
All the best,
September 17, 2018 at 18:11 #2292Maks RusakovičParticipant@wegosi- 29 Topics
- 104 Posts
Hello @themosaurus
Thank you. Yes, I use custom field name. Now, it’s working.
How to add AGE info before location? Because I also use other plugin for birthdate.September 22, 2018 at 10:18 #2464@themosaurus- 1 Topics
- 1675 Posts
Hi @wegosi,
It is necessary to proceed in the same way as for the location field:
if ( ! function_exists( 'gwangi_buddypress_member_birthdate' ) ) : /** * Print the HTML for the BP xProfile Age textfield. * * @since 1.0.0 */ function gwangi_buddypress_member_birthdate() { if ( function_exists( 'xprofile_get_field_data' ) ) : $custom_field = xprofile_get_field_data( 'Age', bp_get_member_user_id() ); $allowed_html = array( 'a' => array( 'href' => array(), 'rel' => array(), ), ); if ( ! empty( $custom_field ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-age"><?php echo wp_kses( $custom_field, $allowed_html ); ?></div> <?php endif; endif; } endif;
Where “Age” is your field name (in your case “Узрост”).
We have taken the lead and the code snippet have already been added to your site.Best regards,
September 25, 2018 at 15:48 #2542 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘Country, city list for search.’ is closed to new replies.