Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to position profile fields within members directory


  • jamesdoherty1708
    Participant

    @jamesdoherty1708

    I’m using the following to add profile information to the members directory, and its working, but i cant seem to re-position where the text appears (at the moment its under the ‘add friend’ button).

    function add_pf_to_members_page() {
    $field_content = bp_get_member_profile_data( ‘field=field name here’ );
    if( $field_content != false )
    echo ” ” . $field_content;
    }
    add_action( ‘bp_directory_members_item’, ‘add_pf_to_members_page’ );

    I’d ideally like it moved to the middle of the page – http://tyfy.co/members/, but any advice on how to move the text would be great, i’ve tried CSS but there is no div information.

    Thanks in advance for any help.

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

  • Henry Wright
    Moderator

    @henrywright

    In your template, there will be a line of code do_action( 'bp_directory_members_item' );.

    This is what your add_pf_to_members_page() function hooks to so the output of your function will appear at that exact point in the template. If you want to move the output you’ll need to move the do_action() call or hook to another action.

    Hope this helps.


    jamesdoherty1708
    Participant

    @jamesdoherty1708

    Hi, thanks for getting back to me so quickly @henrywright,

    sorry if this is a really dumb question, but do i need to be using ftp to do that?
    right now i’m editing through my child theme’s function.php section in the wordpress.org theme editor.

    I’ve tried making a members-loop.php section in my child theme to edit the do_action( ‘bp_directory_members_item’ ); but it doesnt seem to be updating on to the site,
    Thanks again, James.

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