This topic has 18 replies, 6 voices, and was last updated 8 years by Abe.

  • Author
  • #1309
     SQadmin
    Keymaster

    SINCE Sweetdate Version 2.8 the profile tabs are handled from WP ADMIN – Sweetdate – BP Profile Tabs.
    The codes below can also be used if you want to do it programmatically.

    See also a more detailed post here:
    https://archived.seventhqueen.com/forums/topic/how-to-add-tabs-next-to-profile-image-extended

    Hi,
    This explains how to add/modify profile tabs starting from theme version 1.5.
    By default we have added 3 tabs: Looking for, About me, My photos(gets photos form rtMedia or Bp-Album)
    This tabs are configured from an array that can be modified by you in sweetdate-child/functions.php

    Let’s add another tab with another profile group named “Social” and modify the name of rtMedia “My photos” tab in “My work”
    You should end up having something like this in your sweetdate-child/functions.php:

    COPY CODE
    //my changes to profile tabs 
    add_action('after_setup_theme','kleo_my_custom_tabs');
    function kleo_my_custom_tabs() 
    {
    	global $bp_tabs;
    	$bp_tabs = array();
    	$bp_tabs['looking-for'] = array(
    			'type' => 'cite',
    			'name' =>  __('Looking for', 'kleo_framework'),
    			'group' => 'Looking for',
    			'class' => 'citetab'
    	);
    
    	$bp_tabs['base'] = array(
    			'type' => 'regular',
    			'name' => __('About me', 'kleo_framework'),
    			'group' => 'Base',
    			'class' => 'regulartab'
    	);
    
    	/* rtMedia tab - only if plugin installed */
    	if (class_exists('RTMedia')) 
    	{
    		$bp_tabs['rtmedia'] = array(
    				'type' => 'rt_media',
    				'name' => __('My work', 'kleo_framework'),
    				'class' => 'mySlider'
    		);
    	}
    
    	/* Bp-Album tab - only if plugin installed */
    	elseif (function_exists('bpa_init')) {
    		$bp_tabs['bp-album'] = array(
    				'type' => 'bp_album',
    				'name' => __('My photos', 'kleo_framework'),
    				'class' => 'mySlider'
    		);
    	}
    	
    	$bp_tabs['social'] = array(
    			'type' => 'regular',
    			'name' => __('Social', 'kleo_framework'),
    			'class' => 'regulartab'
    	);
    }
    

    NEW PAGE TAB. Use it like this below code. “Reasons to join” is the page name

    COPY CODE
    
    add_action('after_setup_theme','kleo_my_page_tab');
    function kleo_my_page_tab() 
    {  
    	global $bp_tabs;
    	$bp_tabs[] = array(
    	'type' => 'page',
    	'name' => 'Reasons to join',
    	'class' => 'pagetab'
    	);
    }

    NOTE:
    For this to work you should have the child theme activated

    #1311
     SQadmin
    Keymaster

    To change the order of the tabs we can remove the default added tabs by reinitializing the array with $bt_tabs = array(); and the adding our own tabs:

    COPY CODE
    
    
    add_action('after_setup_theme','kleo_my_actions');
    
    function kleo_my_actions() 
    {
        global $bp_tabs;
        $bp_tabs = array();
    
        $bp_tabs['base'] = array(
            'type' => 'regular',
            'name' => apply_filters('kleo_extra_tab2',__('About me', 'kleo_framework')),
            'group' => 'Base',
            'class' => 'regulartab'
        );
        
        /* rtMedia tab - only if plugin installed */
        if (class_exists('RTMedia')) 
        {
            $bp_tabs['rtmedia'] = array(
                'type' => 'rt_media',
                'name' => __('My photos', 'kleo_framework'),
                'class' => 'mySlider'
            );
        }
        /* Bp-Album tab - only if plugin installed */
        elseif (function_exists('bpa_init') AND sq_option('bp_album', 1) == 1)
        {
            $bp_tabs['bp-album'] = array(
                'type' => 'bp_album',
                'name' => __('My photos', 'kleo_framework'),
                'class' => 'mySlider'
            );
        }
        
        $bp_tabs['looking-for'] = array(
            'type' => 'cite',
            'name' => apply_filters('kleo_extra_tab1', __('Looking for', 'kleo_framework')),
            'group' => apply_filters('kleo_extra_tab1', 'Looking for'),
            'class' => 'citetab'
        );
    
    }
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1319
     inboxi
    Participant

    this is not working for me and does not change anything. advise?

    i deleted all the tabs except for base and created two new tabs, “More” and “Test”. This is how my sweetdate-child/functions.php code looks:

    <?php

    add_action(‘after_setup_theme’,’kleo_my_actions’);

    function kleo_my_actions()
    {
    global $bp_tabs;

    $bp_tabs[‘more’] = array(
    ‘type’ => ‘regular’,
    ‘name’ => __(‘More’, ‘kleo_framework’),
    ‘class’ => ‘regulartab’
    );

    $bp_tabs[‘test’] = array(
    ‘type’ => ‘regular’,
    ‘name’ => __(‘Test’, ‘kleo_framework’),
    ‘class’ => ‘regulartab’
    );

    }

    ?>

    #1321
     SQadmin
    Keymaster

    You need to have the sweetdate-child theme activated. Also the user you are viewing needs to have some fields from the profile groups completed.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1334
     inboxi
    Participant

    – Also the user you are viewing needs to have some fields from the profile groups completed.
    yes, i forgot about that.

    worked perfect. thanks again!

    #1406
     Gapron
    Participant

    Hello,

    The child theme, caused a server error when I want to activate it.

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    And I can still find a way to change the tab Id from My photos to My Work.

    Any suggestions here?

    Thanks,
    Jeremie

    #1407
     Gapron
    Participant

    There is no way to use two themes as active at the same time.

    #1410
     kellylouise007
    Participant

    Sorry, I don’t understand whats going on.

    My tabs have disappeared entirely.
    I’ve copied the code and added it to the child theme – But nothing.

    Help much appreciated.
    Thanks

    #1412
     SQadmin
    Keymaster

    Hi,
    You need to have the child theme activated. Not two themes active.
    I have posted for you the code above to rename the tab but I’ll copy/paste it again:

    COPY CODE
    
    <?php
    add_action('after_setup_theme','kleo_my_actions');
    
    function kleo_my_actions() 
    {
        global $bp_tabs;
        $bp_tabs['rtmedia'] = array(
            'type' => 'rt_media',
            'name' => __('My work', 'kleo_framework'),
            'class' => 'mySlider'
        );
        $bp_tabs['social'] = array(
            'type' => 'regular',
            'name' => __('Social', 'kleo_framework'),
            'class' => 'regulartab'
        );
        
    }
    ?>
    

    Delete whatever you have in sweetdate-child/functions.php and add the above code. You can then add the login redirect code

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1413
     SQadmin
    Keymaster

    Hi,
    Give us an email at themesupport@seventhqueen.com with temporary access to FTP to see what’s going on

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1414
     Gapron
    Participant

    Hello,

    Nothing changed at all.

    #1415
     SQadmin
    Keymaster

    Hi, It is fine now. You have renamed you “Base” group to “About” so you had to change the code to show that specific tab. I added the code in sweetdate-child at the bottom of the file.

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1416
     kellylouise007
    Participant

    Thank you 🙂 Awesome support as always.

    #1417
     Gapron
    Participant

    Hello, Nothing change on mine here.

    The My Photos remain my photos, and no other tabs added.

    #1418
     SQadmin
    Keymaster

    Hi,
    You need to activate the sweetdate-child. Is it active? If you can’t figure it out email us acces to website and ftp: themesupport@seventhqueen.com

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #1420
     Gapron
    Participant

    Yes the Child Theme is active. And I’ve just sent you an email with my FTP details.

    Thanks,
    Jeremie

    #12038
     Abe
    Keymaster

    custom code for telui:

    //custom code for telui
    add_action('after_setup_theme','kleo_my_custom_tabs');
    function kleo_my_custom_tabs()
    {
        global $bp_tabs;
        $bp_tabs['base'] = array(
                'type' => 'regular',
                'name' => __('About me', 'kleo_framework'),
                'group' => 'Base',
                'class' => 'regulartab'
        );
     
        $bp_tabs[] = array(
                'type' => 'regular',
                'name' => __('Myself Summary', 'kleo_framework'),
                'class' => 'regulartab'
        );
        $bp_tabs[] = array(
                'type' => 'regular',
                'name' => __('My existing Language Level', 'kleo_framework'),
                'class' => 'regulartab'
        );
    return $bp_tabs;
    }
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #122343
     Chillibabe
    Participant

    ‘Hi Abe! Kindly help me with my tabs as well. I enabled the profile tabs but they do not show up on the website except for the default one, About Me. I tried to refresh the page severally with no success. I can’t seem to figure it all out. Thank you. I am also going to email you with my website access just now. Thank you.

    #122526
     Abe
    Keymaster

    Hi there, see the setting in Theme options:

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    Attachments:
    You must be logged in to view attached files.
Viewing 19 posts - 1 through 19 (of 19 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?