• Hi there, I’m finding it hard to identify what selection of my theme in the page.php file I need to match with the buddpress template files.

    Buddypress template is this:

    [HEADER]

    <div id=”container”>
    <div id=”content”>
    [PAGE CONTENT]
    </div>

    <div id=”sidebar”>
    [SIDEBAR CONTENT]
    </div>
    </div>

    [FOOTER]

    and my page.php file comes out as this:

    <?php get_header(); ?>

    <!– BEGIN MAIN WRAPPER –>
    <div id=”main-wrapper”>

    <!– BEGIN MAIN –>
    <div id=”main”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!– BEGIN POST –>
    <div id=”post”>

    <h3 class=”section-title”><?php the_title(); ?></h3>

    <div class=”post-entry”>

    <?php the_content(); ?>
    <?php wp_link_pages(‘before=<span class=”page-links”>Pages: &after=</span>’); ?>

    </div>

    </div>
    <!– EMD POST –>
    <?php endwhile; endif; ?>

    </div>
    <!– END MAIN –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    how exactly should I replace certain parts of the files to make the buddypress parts of my website correctly align within my theme?

    Please help, I’ve tried to understand it as much as possible but I’m still a novice at working CSS

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author @mercime

    (@mercime)

    The BuddyPress compatibility process
    https://codex.buddypress.org/theme-development/wordpress-to-buddypress-theme/

    Walkthrough – https://codex.buddypress.org/theme-development/bp-template-pack-walkthrough-level-easy-2/

    When go through the process, BP template folders/files will be transferred to your active WP theme folder.

    1. Download those BP template folders from your server to your computer hard drive.

    2. Per walkthrough, you will be imposing the HTML structure of your theme onto only 13 files in those folders. So open up the first file, /activity/index.php

    3. At the top of /activity/index.php, replace

    <?php get_header() ?>
    <div id="content">
    <div class="padder">

    with

    <?php get_header(); ?>
    <!-- BEGIN MAIN WRAPPER -->
    <div id="main-wrapper">
    <!-- BEGIN MAIN -->
    <div id="main">
    <!-- BEGIN POST -->
    <div id="post">

    4. At the bottom of /activity/index.php, replace

    </div><!-- .padder -->
    </div><!-- #content -->
    <?php locate_template( array( 'sidebar.php' ), true ) ?>
    <?php get_footer() ?>

    with

    </div>
    <!-- EMD POST -->
    </div>
    <!-- END MAIN -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    5. Repeat the procedure above with the remaining 12 files per walkthrough

    6. Upload revised files to server, clear browser cache

    Thread Starter soulgamer101

    (@soulgamer101)

    thanks a lot. I’m nearly there!

    I was just replacing the said coding on the last pathway /registration/activate.php

    the end of the post has coding in between and instead of looking like this:

    </div><!-- .padder -->
    </div><!-- #content -->
    <?php locate_template( array( 'sidebar.php' ), true ) ?>
    <?php get_footer() ?>

    it looks like this:

    </div><!-- .padder -->
    	</div><!-- #content -->
    
    	<?php locate_template( array( 'sidebar.php' ), true ) ?>
    
    	<?php do_action( 'bp_after_directory_activity_content' ) ?>
    
    	<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 get_footer() ?>

    how should I replace the said coding – replace all of it or replace around the coding not covered in what you said? please message asap as I’m doing it right now.

    Plugin Author @mercime

    (@mercime)

    </div>
    <!-- EMD POST -->
    </div>
    <!-- END MAIN -->
    <?php get_sidebar(); ?>
    <?php do_action( 'bp_after_directory_activity_content' ) ?>
    <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 get_footer(); ?>

    In a lot of the bp 1.5 beta files there is a – do_action( ‘bp_before- (for example)

    <?php do_action( 'bp_before_directory_members_page' ); ?>

    between the <?php get_header( ‘buddypress’ ); ?> and <div id=”content”> and also at the end of most of the files there is a – do_action( ‘bp_after- (for example)
    <?php do_action( 'bp_after_directory_forums_page' ); ?>
    before the last items

    <?php get_sidebar( 'buddypress' ); ?>
    <?php get_footer( 'buddypress' ); ?>

    Should these be included or can they safely be excluded ?

    Plugin Author @mercime

    (@mercime)

    Those are called action hooks which BP plugin and more often theme devs sometimes use for child themes. Having said that, those action hooks can be safely excluded from your WP template files.

    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Buddypress compatibility theme issue – replacing buddypress template coding’ is closed to new replies.