fbpx
  1. Home
  2. General
  3. Developer

Chapter: Developer

Snippets, actions, filters, examples of changing theme using code

Show profile fields in the members directory

Code Source: https://pastebin.com/raw/zpg7gwNr This snippet should be added to wp-content/themes/kleo-child/functions.php Note : You will have to adapt this function for your needs by changing the name of the fields Location and Specialization from the example shown. Field names are case sensitive and must match exactly. Examples: $location = bp_get_member_profile_data(‘field=Location’); $specialization = bp_get_member_profile_data(‘field=Specialization’); field=Location represents name of the field that we […]

Show profile fields in the profile header

Code Source: http://pastebin.com/raw/QByiEAhH This snippet should be added to wp-content/themes/kleo-child/functions.php Note : You will have to adapt this function for your needs by changing the name of the fields Location and Specialization from the example shown. Field names are case sensitive and must match exactly. Examples : $location = bp_get_member_profile_data(‘field=Location’); $specialization = bp_get_member_profile_data(‘field=Specialization’); field=Location represents name of the field that […]

Error 404 – Page not found

An Error 404 is generated when the browser is unable to find a page, image, video etc. It’s not unusual to see an Error 404 in WordPress and the most common cause is updating a custom post type or taxonomy, this can occur when updating a plugin. Resolving Error 404 Go to WP Admin > Settings > Permalinks and re-save […]

Admin bar only for admins

If you want to show the admin bar just to Administrator users, add the following code to  functions.php of child theme: add_action(‘after_setup_theme’, ‘remove_admin_bar’); function remove_admin_bar() { if (!current_user_can(‘administrator’) && !is_admin()) { show_admin_bar(false); } }

Troubleshooting an issue

Overview You may encounter various issues when building your site. This is especially true as you add more functionality from plugins and custom code. You can follow the below steps to isolate the issue you’re facing and potentially remedy the situation. For each of the steps below you will need to pure your browsers cache. This can be achieved in […]

How to add a Populated Country List XPROFILE

Hello everyone, this topic is for those who want to have an already populated country list to user xprofile fields instead of adding one by one. Just edit the child theme file “functions.php” and paste the following code: /* If you are using BP 2.1+, this will insert a Country selectbox. Add the function to bp-custom.php and then visit …/wp-admin/users.php?page=bp-profile-setup […]