Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #902510

    BAF
    Participant

    I want a right sidebar on only buddy press pages like the profile but the rest of the site I want full-width. How can I achieve this? I am using the Renew Stack.

    URL: http://wholefoodpb.com
    WordPress: 4.5.1
    X Theme: 4.4.2

    #903359

    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! Please make sure that you set your global layout settings to fullwidth. You can do this in your customizer, Appearance > Customize > Layout & Design > Content Layout.

    And then to make sure that the sidebar will only appear to BuddyPress pages, please follow the following steps below:
    1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
    2] Insert the following code into that new file

    <?php
    
    // =============================================================================
    // VIEWS/RENEW/WP-BUDDYPRESS.PHP
    // -----------------------------------------------------------------------------
    // BuddyPress output for Renew.
    // =============================================================================
    
    ?>
    
    <?php get_header(); ?>
    
      <div class="x-container max width offset">
        <div class="x-main left" role="main">
    
          <?php while ( have_posts() ) : the_post(); ?>
            <?php x_get_view( 'global', '_content', 'buddypress' ); ?>
          <?php endwhile; ?>
    
        </div>
    
        <aside class="x-sidebar right" role="complementary">
    	    <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
    	      <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
    	    <?php else : ?>
    	      <?php dynamic_sidebar( 'sidebar-main' ); ?>
    	    <?php endif; ?>
    	</aside>
    
      </div>
    
    <?php get_footer(); ?>
    

    3] Save the file named as wp-buddypress.php
    4] Upload this file to your server in the child theme’s folder
    wp-content/themes/x-child/framework/views/renew/

    And then please make sure that you already have added widgets for your sidebar. If you haven’t yet, you can add your widget contents in Appearance > Widgets.

    Please let us know if this works out for you.