Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • webusat
    Participant

    @webusat

    Hi,

    I am not sure it that helps but it is placing everything into the menu. So far I haven’t been able to get it to work anyway. I also forgot to mention I am using WP 5.0.3 and BuddyPress 4.1.0 and the code there is for older versions.

    I just want to be able to add the count at the top of the content on the page.

    Thanks for the help!
    Stan


    webusat
    Participant

    @webusat

    Never mind, this wasn’t BuddyPress.

    Thanks,
    Stan


    webusat
    Participant

    @webusat

    Hi,

    I am controlling what appears where by using this code:

    <?php $groupid = bp_get_the_profile_group_id();
    // enter group id in array
    if( in_array($groupid, array(1,2,3,4)) ) : ?>
    

    Stan


    webusat
    Participant

    @webusat

    Hi,

    I have one more question.

    The data appears both in the content area and the sidebar. Is there a way to limit it or control where the fields appear so it doesn’t appear in both places?

    Thanks,
    Stan


    webusat
    Participant

    @webusat

    Hi,

    This is solved and below is what i used to make the field display on the users profile page and in the sidebar:

    
    if ( bp_is_active( 'xprofile' ) ) {
    	$data = bp_get_profile_field_data( 'field=YOUR FIELD NAME' );
    	if ( !empty($data) && strlen($data) > 0 ) {
    	echo "<h4>OUR FIELD NAME</h4>";
    	echo wpautop($data);
      }
    }
    

    Thanks for the help!
    Stan


    webusat
    Participant

    @webusat

    Hi,

    I understand now. Like this:

    xprofile_get_field_data( 'city partners', $user_id = 0 )

    Stan


    webusat
    Participant

    @webusat

    Hi, I had never heard of that so thank you, so far it seems to work! Why do we have to do that? Anyhow, we will test some more and post back.

    One other question. Which is better or does it matter:

    $data = bp_get_profile_field_data( 'field=city resources' );

    or

    $data = xprofile_get_field_data('city resources');

    Thanks!
    Stan

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