Forums

remove sidebar and stretch content (3 posts)

  1. pandaweb
    Member
    Posted 2 years ago #

    i have succesfully removed the sidebar from one of my pages by creating a custom page template, but, the content on the page is not stretching out to where the sidebar used to be. here is my custom template. thanks

    <?php
    /*
    Template Name: forum
    */
    ?>

    <?php get_header(); ?>
    <div id="content-body">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div <?php if (function_exists("post_class")) post_class(); else print 'class="post"'; ?> id="post-<?php the_ID(); ?>">
    <h2>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></h2>
    <?php edit_post_link(__('Edit this page','lightword'), '', ''); ?>
    <?php the_content(''); ?>
    <?php wp_link_pages('before=<div class="nav_link">&after=</div>&next_or_number=number&pagelink=<span class="page_number">%</span>'); ?>
    </div>
    <?php if ( comments_open() && $lw_disable_comments == "false" ) : comments_template(); endif; ?>
    <?php endwhile; else: ?>

    <h2><?php _e('Not Found','lightword'); ?></h2>
    <p><?php _e("Sorry, but you are looking for something that isn't here.","lightword"); ?></p>

    <?php endif; ?>
    </div>
    <?php get_footer(); ?>

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    You'll almost certainly need to give your content body a different id and then use CSS to give it a different width.

  3. figaro
    Member
    Posted 2 years ago #

    I'm in the process of making a tutorial to show exactly how to do this. I should have it posted to my site later today...check there in a few hours and you should see it as the latest post...it will be titled something like "How to create a custom page template in WordPress"

    [link moderated]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.