• I am trying to create a custom php page template that doesn’t display the header or sidebars (basically a static sales page that is blank). I couldn’t find any plugins for this but I did find a great post with some code Im using that is doing part of the job. Here’s the code im using (UPLOADED TO MY THEMES FOLDER):

    <?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(); ?>

    I want to also remove ALL navigation. Heres the page currently:

    http://bigfattruth.com/

    Thank you for your time!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter billysurf

    (@billysurf)

    UPDATE:

    I figured out the blank page BUT I now have a new problem. I’m trying to center everything (looks like its still “seeing” the sidebar. Here’s the code:

    [please read and apply http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

    <?php
    /**
    	Template Name: Sales Page
    
    */
    ?>
    <html>
    <head>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <style type="text/css">
    body { background-color: #cccccc; background-repeat: repeat-y; }
    </style>
    
    <title><?php wp_title( '|', true, 'right' ); bloginfo('name'); ?></title>
    <?php wp_head(); ?>
    </head>
    
    <body>
    <?php while (have_posts()) : the_post(); ?>
    			<div id="content" role="main">
    					<div id="page-content">
    					<?php the_content(); endwhile; ?>
    					</div>
    			</div>
    </div>
    </body>
    </html>

    bigfattruth.com

    Thread Starter billysurf

    (@billysurf)

    <?php
    /**
    	Template Name: Sales Page
    
    */
    ?>
    <html>
    <head>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <style type="text/css">
    body { background-color: #cccccc; background-repeat: repeat-y; }
    </style>
    
    <title><?php wp_title( '|', true, 'right' ); bloginfo('name'); ?></title>
    <?php wp_head(); ?>
    </head>
    
    <body>
    <?php while (have_posts()) : the_post(); ?>
    			<div id="content" role="main">
    					<div id="page-content">
    					<?php the_content(); endwhile; ?>
    					</div>
    			</div>
    </div>
    </body>
    </html>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Page Template’ is closed to new replies.