• Hello,

    I am trying to create a completely blank page (no header, footer, or anything) page template in wordpress.

    I am using this PHP uploaded to my themes directory:

    <?php
    /**
    	Template Name: Page with background only
    
    */
    ?>
    <html>
    <head>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <style type="text/css">
    body { background-color: red;}
    #page-content { width: 640px; margin: 20px auto; }
    #page-content p { font-size: 1em; font-family: Georgia; line-height: 1.5em; text-align: justify; }
    </style>
    <title><?php wp_title( '|', true, 'right' ); bloginfo('name'); ?></title>
    <?php wp_head(); ?>
    </head>
    
    <body>
    <?php while (have_posts()) : the_post(); ?>
    <div id="page-content">
    	<?php the_content(); endwhile; ?>
    </div>
    </body>
    </html>

    However, when i have this page theme in my wordpress page publishing dashboard and i publish a page Nohting shows up.

    literally nothing (if i hit control-u and inspect the code– its totally blank)

    Does anyone know where i went wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I just pasted your code inside a page.php in an empty theme folder and it works. Are you trying to view the pages via their url or the front page? The front page will be blank unless you set one of the pages you created as the front page in the admin under Settings > Reading.

    Try turning DEBUG mode ON and see if there are any errors.
    You could also try die() or echo statements in the page template above.

    Thread Starter pvijeh

    (@pvijeh)

    hmmm that is strange. I am trying to view the page from the URL– but it does not work for me.

    I have the php file in the same folder as my other wordpress page themes– but this one does not work.

    Thread Starter pvijeh

    (@pvijeh)

    It it be because I am using the Studio Press Genesis Framework?

    Sorry I haven’t got a lot of experience with the Genesis Framework.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Create a "Blank" page template’ is closed to new replies.