BuddyDev

Search

[Resolved] BP Profile Tab Pro – Default Tab Error

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14610

    Hi Brajesh,

    Sorry for not being clear. So, say I go and make a new profile tab with slug ‘home’ for User 1 (who is an admission counselor member type). That profile tab will be unique to User 1 with different content. For the code, I replaced ‘group’ with ‘home’ so now for that User, the default landing page on slug ‘home’ works.

    Now, I create another profile tab for User 2 (another admissons counselor member type) and of course I would need to call that slug ‘home’ as well for the code to work, but I can’t – it does not allow me to. It renames it to ‘home-2’.

    Hope that makes sense?

    Thanks again for your help!

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #14611

    Hi Sujee,
    Thank you for clarifying.

    Sorry, the above code I suggested works on the basis of member type.

    Before assisting further, May I ask what you need to create different home pages for different counsellors? Is it because you want to show different content or is there any other reason?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14612

    Yes different content. Each admission counselor represents a college or university and the tab ‘home’ is their own marketing page.

    Thanks again!

    Sujee

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #14613

    Thank you for clarifying.

    In my view, It will make much more sense to have a post type for the counsellors home content and assign a content page entry to a counsellor. After that, you simply put a shortcode in the home tab and it shows the content for that counsellor.

    That way, you can manage the content in better way and also won’t have to create too many tabs for the counsellors.

    What do you think of this approach?

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14614

    Brilliant! I’ll give it a shot. Thank you!!

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #14615

    Hi Sujee,
    You are welcome.

    If you want, I can assist with the code. It is pretty easy to accomplish

    1. Register private post type
    2. In the author box select the assigned counsellor as author
    3. Add the actual content for that counsellor.
    4. Create a simple shortcode to fetch the post for that user and that’s all.

    I believe It may be helpful for others too using the BuddyPress Profile Tabs Pro plugin.

    Best regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14616

    Great thanks! Absolutely – the fact you can not only add your own tabs, but custom content and default tabs per member type makes it even more awesome!

    I’m happy to be a part of the BuddyDev community!

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14617

    Oh sorry just needed to clarify the post type shortcode. I hope I can explain it clearly here.

    1. Create profile tab with slug ‘home’ that is the default landing page for member types ‘admissions-counselors’

    2. Go through the steps you mentioned above

    3. Add shortcode to the ‘home’ content

    ++ it’s the last stage that I am confused on. The code would have to fetch the current bp profile user and then the specific post type.

    So, if I’m a visitor that is not logged in and then clicks on that admission counselors profile, it will get me to the landing page with slug ‘home’ and the shortcode should retrieve that admission counselors specific post I created.

    Am I understanding this correctly?

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #14623

    Hi Sujee,
    You are correct in your assumptions.

    About 3rd:- yes, you are right about that. We can use WP_Query to fetch for the first time and cache the post id in transient for later use. That way, It can be flexible as well as efficient.

    Since we are setting the user at author of the post, we can fetch it based on the post type + author combination.

    Best Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 90
    Sujee Kulendran on #14624

    Hi Brajesh,

    Thank you for clarifying. Can you please help me with one example. How can I achieve this. If I have User 1 with admission counselor member type and then say I create a post with that user 1 as author. How can I accomplish this with the code you provided earlier? Do we need to change it then?

    Thanks again – once I get one working, I should be OK with figuring everything else out.

    Looking forward to hearing back from you!

    Sujee

The topic ‘ [Resolved] BP Profile Tab Pro – Default Tab Error’ is closed to new replies.

This topic is: resolved