fbpx
  1. Home
  2. Developer

Chapter: Developer

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

Changing section icons in profiles and groups

On profile and group pages, you’ll see icon bars like the one shown above. You can change these icons to anything you want, here’s how… 1: CSS IDs Start by finding the CSS selector for the icon you want to change. You will need the id of the <li > element associated with the icon. On profile pages it will end with “-personal-li” and […]

Override front user profile templates in the child theme

The front user profile plugin templates can be easily overridden in the child theme by copying the template files from the plugin folder to the child theme like in the example below : Example, copy the next file : wp-content/plugins/front-user-profile/templates/cover.php -> to the child theme in below location wp-content/themes/typer-child/overrides/front-profile/cover.php Example2 : And for the second one wp-content/plugins/front-user-profile/templates/components/author-box.php -> to the […]

Hide Admin Users from the Members Directory

For any theme using buddy press you will realize it has a members directory page. As an admin user you can hide your profile from other members in the seeko theme. The Seeko theme is normally bundled with one already customizable child theme.you can simply edit the funtions.php file to add the code below or else,  If you’re using this […]

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

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

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