Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)

  • pstidsen
    Participant

    @pstidsen

    Hi danbp

    I have now inserted all of your code in functinos.php, but the only place the admin user disappear is at the “All users”-page. The admin user still shows up at the group members pages and the front page where I have listed all members with the Bowe code plugin.

    I need to hide the admin from the entire site.


    pstidsen
    Participant

    @pstidsen

    It works just with one field! Perfect!


    pstidsen
    Participant

    @pstidsen

    Now the function is runned, but no fields are shown. My code is:

    //Prints xProfile
    function PrintKontaktinformationer() {
    	// we need the user_id first (mandatory outside a loop)
    	$user_id = bp_displayed_user_id();
    	// now we fetch the field data (separate field id's by comma)
    	$my_field = xprofile_get_field_data('10, 9, 1, 11, 12, 13, 14, 15', $user_id);
    	// we built the output
    	echo '<div class="authorinfo">TEST'. $my_field . '</div>';
    }
    // the new hook
    add_action( 'show_PrintKontaktinformationer', 'PrintKontaktinformationer' );

    pstidsen
    Participant

    @pstidsen

    Hi danbp and thanks.

    I have inserted this:

    function pstidsen() {
             // we need the user_id first (mandatory outside a loop)
    	$user_id = bp_get_activity_user_id();
            // now we fetch the field data (separate fied id's by comma)
    	$my_field = xprofile_get_field_data('4, 41,55', $user_id);
    	// we built the output
    	echo '<div class="authorinfo">'. $my_field . '</div>';
    	
    }
    // the new hook
    add_action( 'show_pstidsen', 'pstidsen' );

    I my functions.php and the last line in my template, but it doesn’t work. I get this error:

    Fatal error: Call to undefined function bp_get_activity_user_id() in /data/home/nagcolle/public_html/designerspace.dk/ds/wp-content/themes/bp-mag-child/functions.php on line 17

Viewing 4 replies - 1 through 4 (of 4 total)
Skip to toolbar