Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: adding widgets to a custom page


graphility
Participant

@graphility

Hello again,

First off, I’m a total noob to buddypress development, but better at regular wordpress development. So, here’s how I proceded:

1- in functions.php, I added two widgets, like this:
register_sidebars( 1,
array(
‘name’ => ‘showcaseImage’,
‘before_widget’ => ‘

‘,
‘after_widget’ => ‘

‘,
‘before_title’ => ‘

‘,
‘after_title’ => ‘


)
);

register_sidebars( 1,
array(
‘name’ => ‘showcaseCaption’,
‘before_widget’ => ‘

‘,
‘after_widget’ => ‘

‘,
‘before_title’ => ‘

‘,
‘after_title’ => ‘


)
);

2- I copy/pasted page.php and modified like this (removed loop and sidebar call):

<?php
/* Template Name: Showcase */
get_header();
?>

3- in _inc/css/default.css, I added this custom code:

#showcaseImage{text-align:center; width:720px; height:300px; overflow:hidden; margin:0 5px 0 0; border:1px solid #fff; float:left;}
#showcaseCaption{width:200px; height:300px; overflow:hidden; border:1px solid #fff; padding:0 18px 0 13px; float:left;}

4- in settings, I replaced the homepage by this static one.

That’s the whole hack, I guess. By removing the default css id’s and classes from page.php, and replacing them with my own, I place the widgets wherever I wish. Maybe there’s a better way? Not knowing enough about buddypress, your technique seems complex to me :)

Next step (for you and me): add some sweet jQuery and make this a slideshow :)

Additional next step for me: document this in a tutorial, I’m pretty sure it will come up handy for many.

~ hiddenson

Skip to toolbar