Skip to:
Content
Pages
Categories
Search
Top
Bottom

how do you add wordpress widgets to user profiles in bp

  • @gpo1

    Participant

    this could make bp up there with facebook etc. i want to how to add wordpress blogs sidebar widgets to user profiles . so what user’s blog widget has displays in user’s profile.

    i think have got the widget class code , but not sure how make it work?

Viewing 22 replies - 1 through 22 (of 22 total)
  • @nicolagreco

    Participant

    It should work adding for example <?php wp_tag_cloud(”); ?>, bp is always wordpress, don’t forget ! ;)

    @gpo1

    Participant

    where n which file shall i shall edit the code?

    @gpo1

    Participant

    any help on this?

    @nicolagreco

    Participant

    depends on where do you want put your widgets

    @gpo1

    Participant

    below the group status bar..

    @gpo1

    Participant

    sorry, after my wire section in profiles

    @burtadsit

    Participant

    Howdy, the area I think you are talking about is the default form when you view a member’s profile right? ‘me’ > profile > public. The template that generates that screen is in /member-themes/buddypress-member/profile/index.php

    You’ll see the calls to generate all the sections on that page. One of them is the wire. Line 47:

    <?php bp_wire_get_post_list( bp_current_user_id()… and so on …

    You were gonna make a copy of the theme, make whatever changes you need to run a custom bp member theme and edit that one right? :) I think it’s in the bp rules and code of conduct. I’ll have to check.

    @gpo1

    Participant

    thanks, have you tried it?

    @burtadsit

    Participant

    gpo1, nope. I’ve got too much on my plate right now. I’m not going to be able to do much else except get a site launched by the 1/1/09 deadline.

    I talked to Andy about enabling bp to use standard wp widgets in the member theme. Got a couple of ideas but no time at the moment to play with them. The problem is that mu deals with *one* theme per blog. The members theme is sort of this invisible theme that lurks in the background. mu doesn’t even know about it. Only bp knows about it. It *is* bp.

    The way I understand that widgets work is:

    Register a ‘sidebar’ in mu with a name. 1,2,3 or ‘BP Member Profile’, ‘BP Member Blogs’. The sidebar gets registered to a specific blog id.

    register_sidebar(array('name'=>'Main Sidebar',
    'before_title' => "<h3 class='widgettitle'>",
    'after_title' => "</h3>n",
    ));

    In theme code call mu’s sidebar launcher fn.

    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Main Sidebar') ) : // begin primary sidebar widgets ?>

    I just had some questions that I didn’t have time to investigate. When can I call call register_sidebar()? Any time I want, anywhere I want? I see it done in theme functions.php.

    When I access any bp member theme functions do they execute in the blog id 1 environment? I think so.

    If I register some bp member theme sidebars in bp code will it show up in the mu backend? I think so.

    Seems like only the site admin who owns blog id 1 will be able to add widgets to the member theme. Well that’s a *good* thing. This is a feature.

    Lots of questions and unknowns right now and not much time to explore answers. Have at it! Have fun. :)

    @gpo1

    Participant

    I’ve tried to get it to work,but no enjoy.

    I do you solve this?

    @gpo1

    Participant

    any help on this issue?

    @iamzaks

    Member

    I have edited a couple themes and added widget support, I did not try with the member-theme, but it should behave just like any other theme in which you define sidebars. However, I don’t know if each user will be able to add his own widgets to it. It seems as though you are able to add a widget to the theme, but it should be the same for all users.

    The thing is that the member theme is not treated like any other theme on the WP-Backend, but rather it is a different kind of setup, like a standalone. Am I right on this?

    @burtadsit

    Participant

    I played with the widgets in the member theme for a couple of hours. I couldn’t get it to work. The problem seems to stem from the fact that the member theme code can’t register a sidebar or then call it again.

    I tried registering a sidebar in my theme. Shows up fine. I can add widgets all day long. However when you call dynamic_sidebar(), dynamic_sidebar doesn’t think there are any sidebars to give to the call. The var $wp_registered_sidebars is empty and it just returns.

    I didn’t have a chance to track down $wp_registered_sidebars and find out why it’s confused. The sidebars are associated with a particular blog id. So I tried just using switch_to_blog(1) before dynamic_sidebar() and that didn’t work. Evidently that isn’t enough to populate the $wp_registered_sidebars var during the call.

    @gpo1

    Participant

    what does andy say on this issue?

    @apeatling

    Keymaster

    I’ll look into this, I’ve actually not tried it. Having a widget sidebar for all member themes would be very handy though.

    @gpo1

    Participant

    i am looking forward for this!

    @danielfelice

    Participant

    what is your site burtadsit?

    @gpo1

    Participant

    I’ve got a widget class code maybe this solve the could issue :

    <div class=’widgetcase’>

      <?php if ( !function_exists(‘dynamic_sidebar’)

      || !dynamic_sidebar() ) : ?>

      <?php endif; ?>

    </div>

    any idea?

    @gpo1

    Participant

    I need help on this issue,

    <div class=’widgetcase’>

    <?php if ( !function_exists(‘dynamic_sidebar’)

    || !dynamic_sidebar() ) : ?>

    <?php endif; ?>

    </div>

    It works for normal wp..

    I might be missing something?

    @burtadsit

    Participant

    @gpo1 That’s what doesn’t work. The bp member theme isn’t a normal theme. That seems to be the problem. A normal theme does a bunch of *something* that the bp member theme doesn’t. The mu widget stuff is confused. Doesn’t know what blog id it’s on. Doesn’t like registering a sidebar in it. Dunno what it is, but it’s something.

    @gpo1

    Participant

    burtadsit, but this feature needs to be looked at because we can use most of the wordpress plugins and its very handy for users!

    I hope Andy could shed some light on this…

    @gpo1

    Participant

    Any idea on this, Because it’s very handy with all does wp widgets?

Viewing 22 replies - 1 through 22 (of 22 total)
  • The topic ‘how do you add wordpress widgets to user profiles in bp’ is closed to new replies.
Skip to toolbar