1. Home
  2. 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 […]

Change “SIGN UP” URL at Modal Popup

If you want to change the URL of the SIGN UP link at the modal popup in SweetDate theme, you would need to edit the popup file at the child theme. How to change the Create an account link: At your website files, find wp-content/themes/sweetdate/page-parts and copy the file general-header.php Go to wp-content/themes/sweetdate-child/page-parts ( create the page-parts folder if you […]

Error 404

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); } }

How to change logo url

To change the URL of the logo on click, follow these steps: Add this function in child theme functions.php Example 1 /* Set logo a href link to home */ function sq7_custom_logo_href() { //$kleo_logo_href = ‘google.com/’; $kleo_logo_href = home_url(‘/home/’); return $kleo_logo_href; } add_filter(‘kleo_logo_href’, ‘sq7_custom_logo_href’); Replace home_url(‘/home/’); with new route like : home_url(‘/category/post-1’); or for external website use commented line example […]

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 […]

Introduction to the child theme

Child themes allow you to make small or large changes to the parent theme’s design or structure in an update safe way. Any changes made in the Our theme child theme override original files. To get started with using a child theme you’ll first need to have the Our theme theme installed, then install and activate the child theme that […]

How to add Profile Fields under Member Name at Members Directory

You can change the info that displays under the name and the details field by adding this to your sweetdate-child/functions.php file: //members page fields 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 / […]