• Resolved Mahadras

    (@mahadras)


    Hello,

    since there is no template for a no-sidebar-page I tried to make one myself. So far the actual ‘no-sidebar-page.php’ works but there are still css adjustmens I don’t get along with.

    To use the full width of the side my code looks like this:

    .page-template-no-sidebar-page-php #content, .page-template-no-sidebar-page-php .post {
    	width: 990px;
    }

    However, there still is the background color of the sidebar to change that my code looks like this:

    .page-template-no-sidebar-page-php #content, .page-template-no-sidebar-page-php .post, page-template-no-sidebar-page-php site-sidebar .widget {
    	width: 990px;
            background-color: #fff;
    }

    Sadly, this doesn’t work because if I change the background-color the background of the content moves like 10px to the left.

    Want to see it in action? Click Here

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author csthemes

    (@csthemes)

    Create a new template file ‘no-sidebar-page.php’ with the following codes:

    <?php
    /**
     * Template Name: Full Width Page
     *
     * The template for displaying full width pages with no sidebar.
     *
     * @package Nu Themes
     */
    
    get_header(); ?>
    
    	<div class="row">
    		<main id="content" class="col-xs-12 content-area" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
    
    				<?php get_template_part( 'content', 'page' ); ?>
    
    				<?php
    					if ( comments_open() || '0' != get_comments_number() )
    						comments_template();
    				?>
    
    			<?php endwhile; ?>
    
    		<!-- #content --></main>
    	<!-- .row --></div>
    
    <?php get_footer(); ?>

    Then add the following codes to the ‘style.css’ file:

    body.page-template-no-sidebar-page-php .main-inner {
    	background: #fff;
    	}
    body.page-template-no-sidebar-page-php .hentry {
    	margin-right: 0;
    	}

    Good Luck!

    Thread Starter Mahadras

    (@mahadras)

    This works perfectly! Many thanks!

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

The topic ‘No-sidebar-page’ is closed to new replies.