Helping you Build Your Own Social Network!

Faster, better and easier!

Problem showing xprofile_get_field_data

(12 posts) (2 voices)
  • Started 1 year ago by b4b4b0z0r6
  • Latest reply from Brajesh Singh

  1. Hello
    I made a website for an university which i have a field called class number. i used to show it in a php widget using “”
    just today i deactivated the widget and put this cod in the sidebar under the username!
    now i see it doesn’t show if they are not in their profile! it only works in their profile! whether it was working before that!
    i thought maybe the problem is because of the sidebar! so i activated the widget again but it also not shown in widget! which was working until yesterday!

    Posted 1 year ago #
  2. Hi Mahdi, what code you used there ?
    I can't see the code. Most probably, you are missing to specify the member id in the code(which defaults to displayed user id when viewing member profile page), that's why it is happening. please let me know the code. Also, are you trying to show it for logged in user ?

    Posted 1 year ago #
  3. im using this '<?php echo xprofile_get_field_data( "Intake Code"); ?>' it was working before i want to show this field of profile for each user

    Posted 1 year ago #
  4. You will need to pass the user id as the second argument in the function. That is optional(for profile page) but you need it for other pages.

    depending on how you are printing the list(using member loop ?) , you will need to pass the member id. If you are using member loop, then you can use bp_get_member_user_id() in the second argument.

    Posted 1 year ago #
  5. could you make the full code
    but it was working before
    it was showing their field value before

    Posted 1 year ago #
  6. i have added ' ,bp_get_member_user_id()' but it is still not working

    Posted 1 year ago #
  7. Hi Mahdi,
    Can you please put the code somewhere like pastebin.com
    I need to know how you are fetching the user information (like avatar/name etc) to find what code will work there.

    Posted 1 year ago #
  8. check this out
    http://pastebin.com/fGsXHVRA

    Posted 1 year ago #
  9. hello! brajesh any update on this ?

    Posted 1 year ago #
  10. Hi Mahdi,
    I see the code there but that won't be of any help. ads it is the same code you posted here. I need to know about the loop. How you are looping for the members ?

    Posted 1 year ago #
  11. what you mean? i am just using buddypress and its default theme

    Posted 1 year ago #
  12. Mahdi,
    I need the whole code which you are using to output the member list. what is that code? It should be a block of code with some for/while loop I guess?

    Posted 1 year ago #

Reply

You must log in to post.