Support » Plugin: BuddyPress Docs » Full Page width when editing and viewing

  • Hello

    Is it possible to have BP Docs pages show full page width?

    On my pages and posts I can show page attributes and change the template that’s used to a full page width.

    It’d be great to have BP Docs show full width. I have it working at the moment but that is without a sidebar on the whole site.

    I’ve had a look at the BP Docs files and I’ve had a look at the BP-Themes> BP-Default files and commented out the sidebar call but it had made no odds. I’m over my head at this point and would really appreciate some guidance.


Viewing 10 replies - 1 through 10 (of 10 total)
  • I was really hoping that someone might have come up with an answer for me by now.

    Just to add an element that I’ve tried… I searched all files and folders in the BuddyPress Docs plugin and deleted every line and reference to the sidebar. This seems to have had no effect (which I couldn’t believe)!




    We had the same problem. In fact, our research online shows that many people are in the same situation. Fortunately, my colleague found a work-around on a forum.

    Simply put the following line at the end of your /wp-content/plugins/bp-custom.php file:

    add_filter( 'bp_docs_do_theme_compat', '__return_false' );

    This fixed the problem for us. I hope it does for you too.


    Thanks evrenk

    That’s kind of what I’m looking for but not quite. Doing that loses all of the styling and pushes my side bar down the page.

    I can get the look via CSS is the web inspector hiding the side bar and setting the main div to 100% but obviously this doesn’t stick.

    I’m sure there’s a technical reason why it’s not available but it’d be great if I could just choose a full width template.

    Okay. I’m starting to get somewhere with conditional formatting.

    I’ve used…

    <?php if ( 'bp_doc' == get_post_type() ) : ?>
    <?php else : ?>
    <?php get_sidebar(); ?>
    <?php endif; ?>

    to check to see if the page is a bp_doc and if it is then don’t show the sidebar, if it isn’t then do show the sidebar.

    I swapped the <?php get_siderbar(); ?> in my theme’s page.php file and it works.

    The problem that I have now is that my CSS isn’t doing the business and expanding my main content area to 100% width like it should when I remove all my widgets from the sidebar using the dashboard menu.

    I’ve noticed that my secondary div where my sidebar usually would be still shows up which is why the primary div isn’t filling all the way.

    I’ll keep plugging away.

    Got it.

    In the sidebar.php file add the conditional statements.

    I’m using twenty twelve and so there was one in there already (if theres widgets show the sidebar, if not then don’t).

    I just joined in with this one and said if the page is a bp_docs page don’t show the sidebar, if it isn’t then check to see if there’s any widgets, if there are show the sidebar, if there’s not then don’t.

    Code looks like this. Not sure if this should be done with an else if or not but it’s working and I’m happy.

    <?php if ( 'bp_doc' == get_post_type() ) : ?>
    <?php else : ?>
    <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php dynamic_sidebar( 'sidebar-1' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>
    <?php endif; ?>

    Currently have the above working for individual docs pages. Would love to get this working for the docs directory page at /docs and the archive pages.

    Sidebar doesn’t show and the secondary div isn’t in the html but for some reason the css for the primary is still set to 66%.

    I’ve noticed that there was the CSS class of full-width applied to the body tag on full width pages.

    I first thought about trying to add that class somewhere in the BP Docs files so that it’s added to every BP Docs page.

    I found where the class is added (includes/compontent.php) line 1003 but then I thought that this (as a lot of this so far) isn’t very upgrade proof.

    The simpler solution for me was to apply the CSS rules to the body.bp-docs and body.archive classes.

    I have it all working as required.

    Now I need to move my changes from my sidebar.php to a child theme to maintain update/upgradeablilty.

    Apologies for so many posts but I thought it might be useful to others who might want to do the same as I.

    Just for completeness.

    Adding the bod.archive rules effected other wordpress pages such as the post archive pages.

    The rule to add was

    I have a twenty twelve child theme that I could upload to dropbox for anyone who might find it useful. Just let me know.

    Final Answer!

    This is the code that sits in my sidebar.php file. The code checks to see if it’s a BP docs post type or archive page and doesn’t show the sidebar if it is. Then it checks to see if there should be a sidebar on the page and shows it if there should be…

    <?php if ( 'bp_doc' == get_post_type() || is_post_type_archive( 'bp_doc' )  ) : ?>
    <?php else : ?>
    <?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
    		<div id="secondary" class="widget-area" role="complementary">
    			<?php dynamic_sidebar( 'sidebar-1' ); ?>
    		</div><!-- #secondary -->
    	<?php endif; ?>
    <?php endif; ?>

    I tried pasting that code into my theme’s sidebar.php file and it didn’t work. My buddypress docs still shows the sidebar.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Full Page width when editing and viewing’ is closed to new replies.