Skip to:
Content
Pages
Categories
Search
Top
Bottom

Creating Custom Member Types

  • @jblevins1991

    Participant

    I wrote the following code and put it in functions.php inside of the bp-default theme. Is this wrong? If so where should i put it?

    
    
    /*
    *	Create the custom coach role for users.
    */
    function createRoles(){
    	//create coach roles
    	$type = "Coach";
    	$args = array("labels" => array("name" => "Coaches", "singular_name" => "Coach"), "has_directory" => "Coaches");
    	bp_register_member_type($name, $args);
    }
    
    add_action('bp_register_member_types', 'createRoles');
    
Viewing 6 replies - 1 through 6 (of 6 total)
  • @danbp

    Participant

    Hi !

    bp-default is a deprecated theme since 1.7 (2013) and only in for backward compatibility.

    If you use latest BP, you can use almost any existing theme and preferably with a child-theme if you customize your site.

    Custom code can be added to bp-custom.php or into child-theme’s functions.php

    References
    bp-custom.php
    member_types

    @jblevins1991

    Participant

    Worked like a charm!

    Is the member directory /members/index.php and the loop for the directory is /members/members-loop.php? right?

    @danbp

    Participant

    Yes !
    allmost all member related loops are in bp-templates/bp-legacy/buddypress/members/ and in /members/single/ for the profile template

    @jblevins1991

    Participant

    If I change code like the h3 tags or something will the changes show up on the members directory page? I am trying to modify the bp-default because im not very familiar with child themes. I figure if I modify the parent theme it would show up on the main theme right?

    @danbp

    Participant

    Arrrgggl ! 🙂 You’re loosing your time by trying to do that. BP Default will be definetly built out soon.
    Read WP codex about child theme and use this solution in any case. Whatever change you make in a core file will be owerwriten at next update. Theme modification should be made from within a child-theme, so it is safe even when an update is made on the original.

    And read at least here about BuddyPress theming.

    @jblevins1991

    Participant

    I am really confused about how a child theme overrides a standard theme. So does the child theme just have to be named Twenty Sixteen Child and it will override Twenty Sixteen?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar