Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hand-coding widgets into theme OR is there a plugin that remembers the defaults?


  • jayemes
    Participant

    @jayemes

    I’m running into a hurdle I’m hoping some of the more seasoned WPMU/BP people can help me with. If you’ve set up a BP community, this will likely be a simple fix, so please bear with me.

    My problem is that when a new user sets up a blog on my WPMU install, I will have to go into their BP theme and manually set up the widgets in their respective positions so all my users have the same look & feel. This seems kind of crazy to me.

    Now, I’ve seen a few posts here saying the widgets will need to be hand-coded into the default theme in order for the widget setup to be the same for all new blogs created. I’ve typically had no problem doing this for the usual WP themes but am at a total loss with the BP theme.

    My questions:

    1) Is hand-coding these widgets into my default theme my only option? And, if so, does anyone have any guides on doing this for a non-php guy like myself? I’m lost as to where to start.

    2) Are there any plugins out there that will ‘remember’ my widget positions/setup on my default theme and just copy that for each new blog created? This is preferred obviously.

    I’m hoping someone can help me out with this. I would be very thankful. Thank you in advance!

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

  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    Currently there is no “Default Blog Widgets” plugin, but I’ve thought long and hard about making one. :)

    Currently hard coding the sidebars is our only option to do this. It isn’t difficult, but it does involve some knowledge of HTML and WordPress/BuddyPress functions.

    There are however tons of articles in the WordPress codex on how to do this, as well as write ups from random WordPress enthusiasts all over the web that explain very well how to do this.

    The way I did it, was to copy the buddypress-home theme files into a new directory called buddypress-user. Edit the style.css file and rename the second theme to whatever you’d like. Delete home.php. Delete the sidebar code in functions.php. Go into sidebar.php and delete the widget function call. Still in sidebar.php, start editing and inserting your HTML and php functions.


    jayemes
    Participant

    @jayemes

    Thanks John James. Those are some valuable tips. I’ll give that a shot and dive in. Much appreciated.


    jayemes
    Participant

    @jayemes

    My next question is about calling the different sidebar widgets to where the sidebar code was. I believe this was where I got stuck the last time. What is the best way to go about doing this with the right code?


    jayemes
    Participant

    @jayemes

    For example, what is the easiest way to call ‘recent blog posts’?


    jayemes
    Participant

    @jayemes

    I am using a plugin that makes all of my new blog signups an ‘editor’ of their own blog. I want to use Buddypress and have all of the widgets the same for all of my new blogs, so they look the same. Is there a way to do this so I don’t have to set up each blog’s widget positions as it’s created? I can’t imagine every Buddypress install out there gives their users admin access to change the templates? Clearly I must be doing something wrong.


    Burt Adsit
    Participant

    @burtadsit

    Currently the bp widgets can’t be called as template functions.


    nicolagreco
    Participant

    @nicolagreco

    You could do that making the $args an array that contains values that have to be extracted, for example $before_widget that is in the code has to be

    $args = ‘<div class=”my_class”>’;

    $args = ‘</div>’;

    $args = ‘<h2>’;

    $args = ‘</h2>’;

    and us $args in the function like bp_widget_you_want( $args )


    jayemes
    Participant

    @jayemes

    Thanks for the feedback guys. What I’ve resolved to do was code a new WP blog template to be used exclusively for the blogs on the site while using the default BP for the member pages, similar to the setup of http://testbp.org/

    I originally wanted to use BP’s beautifully-created default theme for both the member pages and the blogs, but apparently this cannot be done (which I find shocking)…unless you want to hard-code the BP template. I would do this but it’s simply out of my league and I wasn’t able to find the help on the forum on how to do this.

    I signed up for a test account with http://testbp.org and found they aren’t even using the default BP theme for blogs but a generic WP blog theme. I’m surprised because part of the appeal of using BP is that all the components are nicely integrated both in design and functionality. Using the default WP theme for the blog breaks the design aspect and makes the functionality that much more difficult to do for frontend guys like myself.

    I’m going to stick with WPMU/BP for now and hope a plugin is made that remembers widget positions for all blogs created, thus allowing me to stick with the default BP theme for blogs, or a non-widgetized version of the default BP theme. I would pay for that to be done and I might have to look into that rather than create a whole new theme for my blogs that doesn’t even keep the look and feel of BP.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hand-coding widgets into theme OR is there a plugin that remembers the defaults?’ is closed to new replies.
Skip to toolbar