Create new tabs

This topic contains 54 replies, has 3 voices, and was last updated by  Giri 7 years, 3 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #266

    Derek Curdie
    Free User
    Post count: 36

    Im wondering how do i create new tabs in the profile part of usersWP all i can see is the default 3 (More Info, Posts and Comments)

    #267

    Guust
    Moderator
    Post count: 29970

    What other tabs you have in mind?
    Thanks

    #268

    Derek Curdie
    Free User
    Post count: 36

    right now i was thinking of adding a About Me, Contact info and Hobbies but i was hoping to be able to create new tabs when the time comes up.

    #269

    Guust
    Moderator
    Post count: 29970

    Have a look at https://userswp.io/docs/userswp-form-builder/
    Selecting “profile page own tab” will create a new tab, and organising fields below the fieldset will add them to the new tab.

    Thanks

    #270

    Derek Curdie
    Free User
    Post count: 36

    I dont see a way to create custom tabs only built in tabs i only see Users Page, More Info, Profile page own tab and Profile Side.

    I hope im explaining it correct when i say a custom tab – a tab that i create

    #271

    Guust
    Moderator
    Post count: 29970

    Create a new fieldset, make sure it is public and set to Profile page own tab and Profile Side.
    Then create a custom field and place it below the fieldset. Make sure it is active, and set to Profile page own tab and Profile Side.

    #272

    Derek Curdie
    Free User
    Post count: 36

    that doesnt give me clickable tabs only headings.

    What im wanting is tabs like

    About Me / Contact Info / Hobbies /

    etc

    when the user clicks on 1 tab its only the info related to that tab that shows.

    #273

    Guust
    Moderator
    Post count: 29970

    Please post your URL and WP admin details in a private reply so we can check your settings.
    You should have new tabs if you do it correctly.

    #274

    Derek Curdie
    Free User
    Post count: 36
    This reply has been marked as private.
    #275

    Guust
    Moderator
    Post count: 29970

    I’ll get Giri to look at this.
    Can you change your permalinks as per https://userswp.io/docs/basic-installation/ ?

    #276

    Derek Curdie
    Free User
    Post count: 36

    ok thank you and have done

    #277

    Giri
    Expired Member
    Post count: 3155

    Hi Derek,

    I hope you are talking about non UsersWP fields when you mean custom tabs.

    Its possible. But it requires some code. You need to add it in child theme functions.php or use code snippets plugin to add the code.

    Here is the sample code.

    
    
    add_filter('uwp_profile_tabs', 'uwp_add_profile_custom_tabs', 10, 3);
    function uwp_add_profile_custom_tabs($tabs, $user, $allowed_tabs) {
        
        $tabs['xxxxx']  = array(
            'title' => 'Hello',
            'count' => 1
        );
        
        return $tabs;
    }
    
    add_action('uwp_profile_xxxxx_tab_content', 'uwp_add_profile_xxxxx_tab_content');
    function uwp_add_profile_xxxxx_tab_content($user) {
        echo "Hello World";
    }

    Replace xxxxx with you tab id. example hello_world

    Hope that helps.

    #278

    Derek Curdie
    Free User
    Post count: 36

    Hi there

    Would i have to do that for all the custom tabs i want to create

    #279

    Giri
    Expired Member
    Post count: 3155

    Hi Derek,

    Guust just clarified that you are talking about userswp fields. Let me check your site whats wrong.

    Thanks

    #280

    Derek Curdie
    Free User
    Post count: 36

    On the profile page i want the tabs

    General, Contact Info, About me,

Viewing 15 posts - 1 through 15 (of 55 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket