Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

BP Columns theme – front page center widget (4 posts)

Started 4 months, 3 weeks ago by: Harty

  • Profile picture of Harty Harty said 4 months, 3 weeks ago:

    Hi.
    Trying to place a slidedeck function on the front page – to sit below the header – but still can’t work out where to put the code for a custom widget for the front page to achieve this.
    Any help would be appreciated.
    Thanks.

  • Profile picture of Harty Harty said 4 months, 3 weeks ago:

    I have experimented adding code to the index.php in both the standard buddypress theme and the columns theme, but to no avail.
    Can any experienced users please help me as I really want to have a video on the front page.
    Cheers all.

  • Profile picture of @mercime @mercime said 4 months, 3 weeks ago:

    Open up your chlid theme’s functions.php file and replace this:

    function bpcol_register_sidebars() {
    register_sidebar(
    	array(
    		'id' => 'left sidebar',
    		'name' => 'Left Sidebar',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>'
    	)
    );
    }

    with

    function bpcol_register_sidebars() {
    	register_sidebar( array(
    		'id' => 'left sidebar',
    		'name' => 'Left Sidebar',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>'
    	) );
    	register_sidebar( array(
    		'id' => 'homepage-widget',
    		'name' =>  'Home Page Widget',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3 class="widgettitle">',
    		'after_title' => '</h3>'
    	) );
    }

    Then open up index.php of the chid theme and add the following between <?php do_action( 'template_notices' ) ?> and <div class="page" id="blog-latest" role="main">

    <?php if ( is_active_sidebar( 'homepage-widget' ) ) : ?>
    	<div id="homepage-widget">
    		<?php dynamic_sidebar( 'homepage-widget' ); ?>
    	</div>
    <?php endif; ?>

    Save both files and upload to the child theme folder in server.

  • Profile picture of Harty Harty said 4 months, 3 weeks ago:

    Thank you so much. I never would have worked that out.
    Big grin :-)