Tags

STEP 3 of the BuddyPress Template Pack plugin compatibility process.

You need to create two new files, header-buddypress.php and sidebar-buddypress.php to make your theme compatible with BuddyPress.

If you’ve revised any of the BP template files transferred to your swagger theme folder in server during the BP Compatibility process, please delete the 6 BP folders transferred to your swagger theme folder in server – activity, blogs, forums, members, groups, register – then re-run Appearance > BP Compatibility again to make sure that you have clean template files.

A. Copy header.php and Save As > header-buddypress.php

Open up header-buddypress.php and at the bottom of the file, below other code contained within, add this:

<?php
//set theme options
$oswc_page_sidebar_unique = $oswc_other['page_sidebar_unique'];
$oswc_article_slider_hide = $oswc_other['page_article_slider_hide'];
// use variables from page custom fields instead of swagger options page (if they exist)
$override = get_post_meta($post->ID, "Featured Image Size", $single = true);
if($override!="" && $override!="null") $oswc_featuredimage_size=$override;
$override = get_post_meta($post->ID, "Hide Article Slider", $single = true);
if($override!="" && $override!="null") {
	$oswc_article_slider_hide=$override;
	if($oswc_article_slider_hide=="false") {
		$oswc_article_slider_hide=false;	
	} else {
		$oswc_article_slider_hide=true;
	}
}
//setup variables
$sidebar="Default Sidebar";
if($oswc_page_sidebar_unique) { $sidebar="Page Sidebar"; } //which sidebar to display
?>
<?php oswc_get_template_part('sharebox'); // show the sharebox ?>  
<div class="main-content-left">
<div class="page-content">
<div class="content-panel">

Save file.

B. Create a BLANK sidebar-buddypress.php

Open up sidebar-buddypress.php and paste this:

</div></div>
<br class="clearer" /></div>
<div class="sidebar">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar($sidebar) ) : else : ?>
<div class="widget-wrapper">
<div class="widget">
<div class="section-wrapper">
<div class="section">
<?php _e(' Swagger Magazine ', 'swagger' ); ?>
</div>
<div class="textwidget">  
<p><?php _e( 'This is a widget panel. To remove this text, login to your WordPress admin panel and go to Appearance >> Widgets, and drag &amp; drop a widget into the corresponding widget panel.', 'swagger' ); ?></p>
</div></div></div>
<?php endif; ?></div>
<?php if ( bp_is_register_page() ) : ?>
        <script type="text/javascript">
                jQuery(document).ready( function() {
                        if ( jQuery('div#blog-details').length && !jQuery('div#blog-details').hasClass('show') )
                                jQuery('div#blog-details').toggle();
                        jQuery( 'input#signup_with_blog' ).click( function() {
                                jQuery('div#blog-details').fadeOut().toggle();
                        });
                });
        </script>
<?php endif; ?>
<br class="clearer" />

Save file.

C. Upload header-buddypress.php and sidebar-buddypress.php to your theme folder in server wp-content/themes/swagger/ – the same directory where your regular header.php and sidebar.php are in

D. Copy the style modifications made in BP Twenty Ten to bottom of your theme’s stylesheet http://codex.buddypress.org/legacy/theme-dev-bp-template-pack-walkthrough-twenty-ten-bp-1-5/3/ Adjust to taste.

About these ads