Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Correct usage of the sidewide.css


John James Jacoby
Keymaster

@johnjamesjacoby

If you want your bpmember and bphome theme header.php and footer.php files to always be in sync, this is what I do. It’s a little tricky, but it works really well at keeping multiple theme files totally in sync.

Copy the code below into a file called hf-sync.php and put it in your wp-content/plugins directory. Then in your WordPress Site Admin, goto your plugins area and activate the plugin called “BuddyPress Synchronized Header/Footer”

<?php
/*
Plugin Name: BuddyPress Synchronized Header/Footer
Plugin URI: http://buddypress.org
Description: Header/Footer Synchonization Functions
Version: 1.0
Author: John James Jacoby
Author URI: http://johnjamesjacoby.com
Tags: BuddyPress, Header, Footer
Site Wide Only: true
*/

// Call this in your header.php file.
// Rename the function to match your theme name.
function theme_name_header() {
?>
<!-- PUT YOUR HEADER HTML CODE IN HERE -->
<?php
}
?>

// Call this in your footer.php file.
// Rename the function to match your theme name.
function theme_name_footer() {
?>
<!-- PUT YOUR FOOTER HTML CODE IN HERE -->
<?php
}
?>

Then, in whatever header.php and footer.php files that you want to use your universal header/footer code, all you’ll need to do is call the functions above.

This lets you make edits to both of your header/footer files for both/any/all themes that use this code, in one central location.

My guess, is that this would/should work very well in keeping bbPress themes in sync also, provided that you insert HTML code to include what bbPress needs also, and make sure not to include that code if bbPress isn’t loaded.

Skip to toolbar