Skip to:
Content
Pages
Categories
Search
Top
Bottom

Profile page full width


  • enkoes
    Participant

    @enkoes

    Hi there, what should I do to maka the profile page full width?

    I actually found a similar topic posted by another participant profile full width however no answer is given.

    Regards.

Viewing 16 replies - 1 through 16 (of 16 total)

  • Robin W
    Moderator

    @robin-w

    this is normally theme related, so no ‘standard’ answer.


    enkoes
    Participant

    @enkoes

    hmmm… is there any way that we can tackle the issue? I mean you can guide me the correct direction to solve this though it hasn’t any standard solution.


    Robin W
    Moderator

    @robin-w


    u_Oi
    Participant

    @arutam

    bbPress will “adapt” the profile style to your theme templates, so the installed theme must have a full-width template or you can use block layouts.


    enkoes
    Participant

    @enkoes

    Hi, after struggling some time trying to make profile page full width, I give up.

    The theme I’m using is Magbook. I found that there is only one theme template page that has no sidebar, ie, magbook-template.php. I copied this file to my child theme root directory, and rename it as bbpress.php. However it doesn’t make any changes to the profile page.

    I have read some other similar topics, I guess we need to “inject” custom php codes into the bbpress.php. If this is correct, can you provide me the relevant php codes for bbpress.php that make it works?

    One more thing I have doubt is that, let say bbpress finally adopted bbpress.php as default template, all other forum & topic pages will turn out no sidebar altogether, I presumed, which is against my wish. What I want is profile page FULL WIDTH, forum/topic page WITH SIDEBAR.

    Pls guide me.
    Regards


    Robin W
    Moderator

    @robin-w

    so can you post ypur bbpress.php here please, and let me know if it renders a sidebar or not


    Robin W
    Moderator

    @robin-w

    so can you post ypur bbpress.php here please, and let me know if it renders a sidebar or not


    enkoes
    Participant

    @enkoes

    This is the bbpress.php from my theme:

    <?php
    /**
     * Template Name: Magbook Template
     *
     * Displays Magazine template.
     *
     * @package Theme Freesia
     * @subpackage Magbook
     * @since Magbook 1.0
     */
    get_header(); ?>
    <div class="wrap">
    	<?php 	if( is_active_sidebar( 'magbook_primary_fullwidth' ) && class_exists('Magbook_Plus_Features') ){
    		echo '<div class="primary-full-width clearfix">';
    			dynamic_sidebar ('magbook_primary_fullwidth');
    		echo '</div>';
    	} ?>
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    			<?php 
    			if( is_active_sidebar( 'magbook_template_section' )){
    				dynamic_sidebar( 'magbook_template_section' );
    			}
    
    		the_content(); ?>
    		</main><!-- end #main -->
    	</div> <!-- end #primary -->
    	
    		<?php if( is_active_sidebar( 'magbook_template_sidebar_section' )){ ?>
    		<aside id="secondary" class="widget-area" role="complementary" aria-label="<?php esc_attr_e('Side Sidebar','magbook');?>">
    			<?php dynamic_sidebar( 'magbook_template_sidebar_section' ); ?>
    		</aside> <!-- end #secondary -->
    	<?php	}
    	if( is_active_sidebar( 'magbook_seondary_fullwidth' ) && class_exists('Magbook_Plus_Features') ){
    		echo '<div class="secondary-full-width clearfix">';
    			dynamic_sidebar ('magbook_seondary_fullwidth');
    		echo '</div>';
    	} ?>
    	
    </div><!-- end .wrap -->
    
    <?php get_footer();

    Robin W
    Moderator

    @robin-w

    so does this render a sidebar for forum pages?


    enkoes
    Participant

    @enkoes

    No. It doesn’t render sidebar for topic & forum pages.


    enkoes
    Participant

    @enkoes

    Hi sorry, need to clarify a bit….

    bbpress.php does render sidebar for forum/topic pages. However the widgets (eg, forums/topics information) that I initially put on the sidebar no longer be visualized.

    For WordPress normal page setting, if I change template from default template (page.php) to Magbook Template (magbook-template.php), the targeted page becomes full width, that is why I thought that magbook-template.php is a full width template. Maybe I am wrong.

    Hope this would help.
    Regards


    enkoes
    Participant

    @enkoes

    Hi, may I know any possible solution for this?


    webcreations907
    Participant

    @webcreations907

    Try adding the below code to your theme’s functions.php file, should make the userpages full width with no sidebar.

    
    
    if( !function_exists('enkoes_magbook_userpage_css_class') ){
    	function enkoes_magbook_userpage_css_class( $classes ){
    		if( function_exists('bbp_is_single_user') &&  bbp_is_single_user()){
    			$classes[] = 'magbook-no-sidebar';
    		}
    		return $classes;
    	}
    }
    add_filter('body_class', 'enkoes_magbook_userpage_css_class');
    
    if( !function_exists('enkoes_magbook_userpage_options') ){
    	function enkoes_magbook_userpage_options( $options = array() ){
    		
    		if( function_exists('bbp_is_single_user') &&  bbp_is_single_user()){
    			$options['magbook_sidebar_layout_options'] = 'nosidebar';
    			$options['magbook_blog_layout'] = '';
    		}
    		return $options;
    
    	}
    }
    add_filter('magbook_get_option_defaults_values', 'enkoes_magbook_userpage_options',100);
    
    

    You may have to get rid of that bbpress.php file you added.

    I haven’t used Magbook theme before, so let me know if that works out for you.

    😉


    webcreations907
    Participant

    @webcreations907

    Should have mentioned that you should added that into a child theme functions.php file so that when you update the theme you won’t lose that code.


    @robin-w
    usually recommends a code snippet plugin for adding custom code, but I don’t recall the name of that plugin.


    Robin W
    Moderator

    @robin-w


    enkoes
    Participant

    @enkoes

    Yes. Finally solve my long pending problem!

    Many thanks to @webcreations907 & @robin-w for your help & guidance. Never expect this can be solved in one go. 😀

Viewing 16 replies - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.
Skip to toolbar