Support » Fixing WordPress » How to add two-column template?

  • Resolved Mohamad Hanafi

    (@mohamad-hanafi)


    Dear all forumers,

    Curently I have two template layouts
    – three column (two sidebars)
    – one column (full width)

    Now I need to add two column layout template which has left sidebar.

    How to do it?

    My Theme: Box Of Boom.

    Thanks in advanced.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Do you know any basic html? Or you can use WP-Table Reload Plugin.

    Hi, Richard.

    Thanks for you respond.

    This issue resolved.

    1. Add <subpage-name>.php in wp-content/themes/<theme-name>

    Write

    <?php
    /**
     * Template Name: <subpage-name>, left sidebar
     * Description: A one-colum template with left sidebar for <subpage-name> ONLY
     */
    get_header(); ?>

    2. Copy full-width page basic codes.
    3. Add new div for

    <div id="main" class="<subpage-name>-right clearfix" 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>
    		<div id="main" class="<subpage-name>-left clearfix">
    </div>

    4. Set style in css.

    div#main.<subpage-name>-left{width:240px;float:left;}
    div#main.<subpage-name>-right{width:780px;float:right;}
    article{margin-top: -44px;}

    Thanks.

    Hanafi.
    KL.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add two-column template?’ is closed to new replies.