Optional one column page (4 posts)

  1. T B
    Posted 4 years ago #

    Hi guys,

    I would like hide the sidebar from some page.
    I know I can remove the <?php get_sidebar(); ?> from page.php but the theme is three column and we need one column page. Controll would be nice from the "Page Attributes" option on the "edit page"

    I am new with .css yet.

    Thanks a lot!


  2. T B
    Posted 4 years ago #

    New page file create: page_onecolumn.php
    Remove the: <?php get_sidebar(); ?>

    Add the css #page_onecolumn

    #content {
    margin: 0 470px 0 0;/* margin: 0 280px 0 190px;*/
    .side1 {
    width: 250px;
    float: left;
    margin-left: -250px;
    .side2 {
    width: 180px;
    float: left;
    margin-left: -450px;

    #content {
    margin: 0 970px;/* one column */

    Is that ok?

    What is the next step?

    Help please

  3. T B
    Posted 4 years ago #

    I made a custom page-onecolumn.php and add above the header
    I can select on Page attributes-->Template

    Template Name Posts: One Column Post

    I made a custom post-onecolumn.php and add above the header
    I can not select yet! We need a Costom Post Template plugin to get it work.

    Template Name: Onecolumn Page

    Remove the sidebar code from customised page and post files
    <?php get_sidebar(); ?>

    Now I need edit the css.
    Isn't it?

    Help me please :)

  4. T B
    Posted 4 years ago #


    I have copied the style.css and renamed as onecolumn.css

    After insert this code in the header.php

    After this part
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    <?php if(is_page_template('page-onecolumn.php')) :?>
    <link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/onecolumn.css" media="screen" />
    <?php endif;?>

    Now I can edit the onecolumn.css separately

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic