Setting full-width template for groups
-
Hello,
I’m trying to setup a full-width template for all group pages.
According to the documentation you can put a theme file (single.php) in
/wp-content/themes/twentyfourteen-child/buddypress/groups/
but my group pages are not picking up the template.
What am I doing wrong?
Thanks
This my index.php:
<?php /** * Template Name: Full Width Page * * @package WordPress * @subpackage Twenty_Fourteen * @since Twenty Fourteen 1.0 */ get_header(); ?> <div id="main-content" class="main-content"> <?php if ( is_front_page() && twentyfourteen_has_featured_posts() ) { // Include the featured content template. get_template_part( 'featured-content' ); } ?> <div id="primary" class="content-area"> <div id="content" class="site-content" role="main"> <?php // Start the Loop. while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( 'content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } endwhile; ?> </div><!-- #content --> </div><!-- #primary --> </div><!-- #main-content --> <?php get_sidebar(); get_footer();
-
adjunkten – I wish someone would of answered this question – it would help others figure out if that documentation is old and no good, or what… maybe someone else has already answered this exact question in the forums here recently and that is why no one has answered (?)
Have you tried searching the forums to see if there has been another answer to this exact question recently?
A child theme contain usually
style.css
functions.phpTo make it work with BP, you add a copy of the original
page.php
of 2014 and rename itbuddypress.php
2014 comes also with a full-width template which is in page-templates folder.
If you compare both files, you will see that the only difference is at line 40 of page.php
get_sidebar( 'content' );
To get what you want, you simply add a conditionnal to this part.
if( !bp_is_groups_component() ) { get_sidebar( 'content' ); }
That said, i think it’s not necessary, as with or without this hack, BP’s content comes full-width on 2014. At least and by default, in the whole white zone, right of the left black sidebar. Also remind that 2014 is a left aligned theme, which can let think that you have a lot of space on the right, specially on a large desktop screen.
With 2012, it’s a bit different, as this theme use a class called full-width, directly in the html. To use the same technique, we have to echo the div to get the condition to work properly.
And 2013 doesn’t use a full-width template.<?php if( !bp_is_groups_component() ) { echo '<div id="content" role="main">'; } else { echo '<div id="content" class="full-width" role="main">'; } ?>
@danbp –
am I to understand – that you would make a buddypress.php and have just like:
<?php if( !bp_is_groups_component() ) { get_sidebar( 'content' ); } ?>
or maybe copy the page.php code and put it all into a new file buddypress.php – and add the code
if( !bp_is_groups_component() ) { get_sidebar( 'content' ); }
to buddypress.php maybe in the head of it?
BPās content comes full-width on 2014
Actually with my 2014 themed bp site I get a left and right sidebar on large monitor, it does not get into bp stuff taking full side space width until the screen shrinks to.. I dunno 1008 pix or so (one of those media queries)
So I think this code you are suggesting would indeed be useful with 2014 as well.
I have been looking a couple of plugins like ‘dynamic sidebars’ (maybe it was dynamic widgets) – and ‘content aware sidebars’ – one of these I saw recently says is plays well with BP – and I was thinking one of these may be able to solve some common problems that bp peeps run into in regards to wanting to change content on the various psueodo pages.. however I am not sure that any of those plugins would remove all widgets from the sidebar on some pages, and if they DID.. would that make theme X go full width for that area anyhow? not likely, but it’s a nice dream.
Anyhow thanks for the info I might test this out a bit not that I am digging deeper into 2014 and bp..
grr – typos at midnight… should be NOW that I am digging deeper into 2014,,
Hi, thanks for answering.
At least and by default, in the whole white zone, right of the left black sidebar
You can see a group page here
On group pages only, I would like to skip the left vertical black menu bar, to get more space for group forum threads.
Thanks for digging, djsteveb. Keep us posted … š
you could (although this theme is quite tricky with the various sizing things, and I am NOT an expert with this theme or css – so make backups, use child themes – all that jazz)
you could try changing (or overwriting with child theme / enque an overlap style sheet)
@media screen and (min-width: 1218px) { .site-content, .site-main .widecolumn { margin-left: 222px; } }
to:
@media screen and (min-width: 1218px) { .site-content, .site-main .widecolumn { margin-left: 90px; } }
and..
.buddypress .site-content article .entry-content, .buddypress .site-content article .entry-header { max-width: 100%; padding: 0px 10% 5%; }
change to
.buddypress .site-content article .entry-content, .buddypress .site-content article .entry-header { padding: 0px 1% 5%; }
– now of course how these settings affect the groups page is one thing this could cause ill effects on other pages – (ones with double sidebars) – and at different screen sizes.. this 2014 thing gets pretty picky..
especially with 2014 doing one thing, and the bp-addon style thing doing some other things.. one percentage change here looks good – but a different page at a difference screen size – grrr.. you have to test a lot with this mix (come to find out the hard way here the past couple weeks!)
This will add a lot more space, which is what I guess you are going for in general – but not remove all sidebars..
and
That does not get rid of the left sidebar, which is I guess what you were meaning to ask in the first place with this thread (and I think everyone else was assuming you wanted to get rid of the right sidebar, as our understanding of the term “full width page” – err template in my mind is just that.. looks like you really want a “no sidebars at all page template” for groups page?i wrote: To make it work with BP, you add a copy of the original page.php of 2014 and rename it buddypress.php. And you add the condition into that copy.
I’m not a 2014 specialist and never liked that theme with BuddyPress. The’re so many other out to discover, easy to use and configure, that i wouldn’t loose my (at least) time with it.
2015 is already avaible and 2016 too, though 2014 is a dynosaur now. Beat’em ! š
- The topic ‘Setting full-width template for groups’ is closed to new replies.