Thursday, April 29, 2010

BuddyPress And The Missing Admin Bar: Solved!

BuddyPress - WordPress I’ve been working on a few BuddyPress projects lately, using custom themes. Actually, I’ve used a great new plug-in, BuddyPress Template Pack by Andy Peatling to help with custom themes. While this great plug-in got me down the road (it basically turns your existing theme into a BuddyPress compatible theme), there were a few things missing. I wanted to share one I solved, and how.


Once I installed the theme and started working on it, I noticed that there was white space at the top of all my pages, enough room for the BuddyPress admin bar. So I knew it had something to be missing code that wasn’t displaying the admin bar. A quick search on the BuddyPress forum site and I found the solution: Make sure the wp_footer() reference is in your template file.


My theme needed a reference to wp_footer(). There was a reference to get_footer(), but that doesn’t help the admin bar. Once I added the reference, the bar shows up as desired. I call this code snippet in the custom theme where the footer should appear.


<?php
function custom_footer() { ?>
<div id="custom_footer" class="accentBorders">Copyright &#169; 2010 All Rights Reserved.</div>
<?php
wp_footer();
}
?>

Find more BuddyPress goodness at http://buddypress.org/support/topics/.


By the way, BuddyPress is a set of plug-ins that give your WordPress site the ability to create a community.

Share this article

0 comments:

Post a Comment

 
Copyright © 2003 - 2014 Thom Allen Weblog • All Rights Reserved.