WordPress.org

Ready to get started?Download WordPress

Forums

Alternate Page Template - no header and no sidebar (7 posts)

  1. pmars
    Member
    Posted 4 years ago #

    Using WP 2.9.2, Motion 1.0.4 theme:

    Trying to create an alternate page template with no header and no side-bar.

    I have tried all kinds of variations of pages, functions.php, etc..

    Can't get any alternates to actually function.

    Basically I want to have a couple pages with no header and side bar, since the same header is just not appropriate on all pages of the site

    Thanks for any help :-)

  2. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    general outlay:

    no_header_template.php:

    <?php
    /*
    Template Name: Headerless
    */
    get_header('less'); ?>
    
    <div id="main">
    <div id="content">
    
    <!--- change this to do what the template is supposed to do -->
    
    </div><!-- /content -->
    
    <?php // don't get_sidebar(); ?>
    
    </div><!-- /main -->
    <?php get_footer(); ?>

    header-less.php:
    http://wordpress.pastebin.com/36HZajTj
    (this keeps the category nav; remove if needed)
    (included a line with <link href="<?php bloginfo('stylesheet_directory'); ?>/no_sidebar.css" rel="stylesheet" type="text/css" media="screen" /> )

    no_sidebar.css:

    /* style for headless template without sidebar */
    #content {float:left; width:980px;}

    (add more styles if needed)

    related documentation of the codex:

    http://codex.wordpress.org/Pages
    http://codex.wordpress.org/Pages#Page_Templates

    http://codex.wordpress.org/Include_Tags
    http://codex.wordpress.org/Function_Reference/get_header

  3. worthwhileluxury
    Member
    Posted 4 years ago #

    Hello. Sorry for barging in. I also need some pages to display without the side bars but with the header.
    You have code up here but I have no idea where to put it and how to make it apply. Please can you help me?

  4. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    @worthwhileluxury
    it would be better if you could start a new thread.

    the 'code' above is only an outline of some action, and no 'copy/paste' template.

    study the above linked docs of the codex. and search the forum, your idea is not unique, and someone might have answered it already.

  5. worthwhileluxury
    Member
    Posted 4 years ago #

    ok thanks. I have looked but can't find anything helpful. Will look again.

  6. pmars
    Member
    Posted 4 years ago #

    Thanks for the input alchymyth. Got it working.

  7. idowning
    Member
    Posted 3 years ago #

    Pointed me in the right direction. I'm using the custom header on pages that I am using an iframe link to with fancybox. I'll put a link up once the site goes live if you like.

Topic Closed

This topic has been closed to new replies.

About this Topic