Home › Forums › Iconic One Pro Support › BuddyPress Full Width
- This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by Themonic-Support.
- AuthorPosts
- September 18, 2018 at 7:54 pm #5309jaydimeParticipant
Hi I’m trying to make all my BuddyPress pages full-width. It seems like the advice at the following link should work, but it’s not working for me. I’m pasting the Iconic One page template code from full-width.php into a new file called buddypress.php and uploading that to the directory in my child theme. No good. Any tips? Thanks…
“Most of the time BP will use page.php since that template file exists in the majority of WordPress themes. However, if you wanted to style BuddyPress pages differently than a regular WordPress page, you could add a template file named buddypress.php to your theme’s directory and BP would use that template instead since that file is ahead of page.php in the hierarchy above.”
September 19, 2018 at 5:15 am #5310Themonic-SupportKeymasterLine 381 functions.php
if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'themonic-sidebar' ) ) {
make it like this
if ( is_page_template( 'page-templates/full-width.php' ) || is_page_template( 'page-templates/buddypress.php' ) || is_attachment() || ! is_active_sidebar( 'themonic-sidebar' ) ) {
This is when buddypress.php is in a page-templates folder. If it doesn’t work, try without child theme.
September 19, 2018 at 12:53 pm #5311jaydimeParticipantI’m assuming you meant to edit the functions.php file in my parent theme directory, not the child theme (where the functions.php file only has the enqueue style coding). Or should I just be adding your suggested code to the child theme’s functions.php? (… in which case it would not be line 300-something.)
So I edited the parent theme’s functions.php as you suggested, and uploaded buddypress.php to the main theme’s page-templates folder.
It didn’t work on the live site, and it also it did not show in the WP “preview” of the parent theme. I’m reluctant to switch to the parent theme since it would wipe out other more important customizations.
Thanks for any advice you can offer.
September 20, 2018 at 2:03 pm #5313Themonic-SupportKeymasterPlease try on a test installation with parent theme. Also, check template name inside buddypress.php , should be different from full-width.php template name.
September 20, 2018 at 2:25 pm #5315jaydimeParticipantOk I changed the template name inside buddypress.php and then installed the parent theme on a staging site. Still no good.
I have this at line 387 in functions.php:
function themonic_content_width() {
if ( is_page_template( ‘page-templates/full-width.php’ ) || is_page_template( ‘page-templates/buddypress.php’ ) || is_attachment() || ! is_active_sidebar( ‘themonic-sidebar’ ) ) {
global $content_width;
$content_width = 1040;}And the buddypress.php file is in the page-templates folder…
September 20, 2018 at 3:58 pm #5316jaydimeParticipantNot sure if this tells us anything but I just noticed that choosing the (newly renamed) “buddypress” page template from within the WP dashboard for a given page on the site does not make it full width, whereas your standard full width option does.
In other words, selecting under Page Attributes the Full-width no sidebar page template for my pages DOES do what I’d like it to do (though of course only for static pages, not the other buddypress pages), whereas using the new “BP Full-width” brings back the sidebar.
The code for that buddypress.php file is here…
<?php
/**
* Template Name: BP Full-width Page Template, No Sidebar
*
* Description: Normal full width template.
*
* @package Iconic One Pro
*
* @since Iconic One Pro 1.0
*/get_header(); ?>
<div id=”primary” class=”site-content”>
<?php if($options[‘themonic_breadcrumb’] == ‘1’) { ?>
<?php if ( !is_front_page() ) { ?>
<div class=”themonic-breadcrumb”><?php iop_breadcrumb(); ?></div>
<?php } ?>
<?php } ?>
<div id=”content” role=”main”>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php comments_template( ”, true ); ?>
<?php endwhile; // end of the loop. ?></div><!– #content –>
</div><!– #primary –>
<?php get_footer(); ?>
<style type=”text/css”>
.themonic-social-share {
padding: 8px 3px 5px 20px;
width: 102%;
}
</style>September 21, 2018 at 7:37 am #5317Themonic-SupportKeymasterThe last thing we can try is:
Move the buddypress.php from page templates folder to theme root directory and edit the parent functions.php to reflect the changes like below. I think buddypress will look for buddypress.php in theme root directory only.
if ( is_page_template( 'page-templates/full-width.php' ) || is_page_template( 'buddypress.php' ) || is_attachment() || ! is_active_sidebar( 'themonic-sidebar' ) ) {
- AuthorPosts
- You must be logged in to reply to this topic.