This topic has 6 replies, 2 voices, and was last updated 10 years by nusolutions.

  • Author
  • #15135
     nusolutions
    Participant

    Still trying to get extra tabs added next to my member profiles. So I come across this thread:

    https://archived.seventhqueen.com/forums/topic/how-to-add-more-tabs-next-to-the-profile-image

    I make sure the Base profile is named accordingly.
    The child theme is activated.
    I’m logged in as a user who has answered some of the questions in their profile.

    I don’t see any new tabs. Are there any steps which should be taken beforehand? I have the following in my \sweetdate-child\functions.php file:

    <?php
    /**
    * @package WordPress
    * @subpackage Sweetdate
    * @author SeventhQueen <themesupport@seventhqueen.com>
    * @since Sweetdate 1.0
    */

    /**
    * Sweetdate Child Theme Functions
    * Add extra code or replace existing functions
    */

    //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[‘searching-for’] = array(
    ‘type’ => ‘cite’,
    ‘name’ => __(‘Searching for’, ‘kleo_framework’),
    ‘group’ => ‘Searching 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’
    );
    }

    ?>

    Any responses appreciated.

    #15217
     Abe
    Keymaster

    Your group names from Users – Profile fields should match the defined ‘group’ => ‘Base’,

    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.

    #15218
     Abe
    Keymaster

    or ‘group’ => ‘Searching for’, and so on

    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.

    #19372
     nusolutions
    Participant

    Back on this project and I’m still the one kid sitting in the back of the class with his hands up trying to figure it out.
    After having to rebuild the site I’m back to the basics in customizing it. The results are the same for me in that I don’t see any changes or additions to the profile after adding this code to the child/functions.php file. Base is the name of the default profile.

    Again, what am I missing?
    Any chance of this becoming an update added the a future release?

    Any responses appreciated.

    #19409
     nusolutions
    Participant

    In addition I create the following Field Groups
    Base
    Looking for
    About me
    My photos
    Social

    I have RTMedia installed and activated. Nothing.

    I try the other suggestion:
    1. Delete all profile fields/tabs except Base.
    2. Create new Test & More profile fields.
    3. Add this code to sweetdate-child/functions.php

    COPY CODE
    <?php
    /**
     * @package WordPress
     * @subpackage Sweetdate
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Sweetdate 1.0
     */
    
    /**
     * Sweetdate Child Theme Functions
     * Add extra code or replace existing functions
    */ 
    
    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’
    );
    
    }
    ?>

    4. Add info to fields in each tab.

    When viewing the profile I can see the fields below but nothing changes up top in the member profile area.

    Not getting it!!!!

    #19625
     Abe
    Keymaster

    Hi, this should be the code with the Base, More and Test profile group name as they should be defined in Users – Profile fields

    COPY CODE
    
    add_action('after_setup_theme','kleo_my_custom_tabs');
    function kleo_my_custom_tabs()
    {
        global $bp_tabs;
        $bp_tabs = array();
    
     
        $bp_tabs['base'] = array(
                'type' => 'regular',
                'name' => "Base",
                '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[] = array(
                'type' => 'regular',
                'name' => "More",
                'class' => 'regulartab'
        );
        $bp_tabs[] = array(
                'type' => 'regular',
                'name' => "Test",
                'class' => 'regulartab'
        );
    
    }
    

    So make sure the names are the actual group names

    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.

    #19661
     nusolutions
    Participant

    Sooo I went and created some additional profile groups each with their own set of questions:

    About
    Biker Profile
    Features
    Photos
    Seeking

    So instead of listing all of these I only want to display one additional tab: My photos. So here’s what I ended up with which works exactly as I want it:

    COPY CODE
    /**
     * Sweetdate Child Theme Functions
     * Add extra code or replace existing functions
    */ 
    
    //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['base'] = array(
                'type' => 'regular',
                'name' => "About",
                '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')) {
            $bp_tabs['bp-album'] = array(
                    'type' => 'bp_album',
                    'name' => __('My photos', 'kleo_framework'),
                    'class' => 'mySlider'
            );
        }
    
    }
    
    ?>

    Again, awesome support!

Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Adding extra tabs _ stuck (sos)!’ is closed to new replies.

Log in with your credentials

Forgot your details?