Skip to:
Content
Pages
Categories
Search
Top
Bottom

Need Help Implementing certain BuddyPress Tags on ALL PAGES

  • Avatar of jStormThaKid
    jStormThaKid
    Participant

    @jstormthakid

    I am trying to use the php tags/code below, in my right sidebar on every page of my site (which is using the buddy wp theme), but they only work when I click on the members page and I am sure this is because there is something needed from the buddypress-functions page, but Im just not sure what it is… the tags below only work on buddypress pages but not on the other pages that do not have buddypress headers on them… please let me know how to solve this problem… The codes/tags that I am trying to use are located at the link below (it wont let me paste in php)…

    http://pastebin.com/raw.php?i=qLGkGK2K

    Please help, and Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Don’t directly link to the ‘raw’ version of the pastebin code, we can’t easily edit to show revisions.

    If you look at bp-default theme sidebar.php you’ll see examples of how user links , avatars etc can be rendered;  you’re trying to run functions that are only populated from BP classes when on those component pages, so they will fail on normal WP pages.

     

    This would get you the user name and link:

    bp_core_get_userlink( bp_loggedin_user_id() )

    Avatar of jStormThaKid
    jStormThaKid
    Participant

    @jstormthakid

    what if i just want to add the buddypress info to my theme? is this possible… I want it so that whenever my theme is activated, all the buddypress required classes and what not will just run? what would I need to grab out of the buddypress install?

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    @jstormthakid not sure I understand the question.

    BP is installed and activated, therefore it is ‘added’ as it were, you can’t have all template tags / functions working on any old page things don’t work like that, on certain screens BP has created them thus knows what they are for and provides objects to them on a general page BP hasn’t any knowledge it exists so you need to use bp globals or functions as above that do work on any screen / page.

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

You must be logged in to reply to this topic.