Forums

I get an error message when I apply a new page template (5 posts)

  1. luceylin
    Member
    Posted 2 years ago #

    I created a few new page templates for the web site I am building, following the guidance I have found here. I can see and select the new themes, but get an error message when I apply any of the new templates. The error says that no such file or directory on line 38. The code is below. Can someone tell me what I need to do to fix this? I am pretty much a novice, so this might be a really dumb question, but I am just plain stuck. Thanks very much. The template code follows:

    Template Name: Page2Column
    */
    ?>

    <?php get_header(); ?>
    <div class="art-contentLayout">
    <div class="art-content">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="art-Post">
    <div class="art-Post-body">
    <div class="art-Post-inner art-article">
    <h2 class="art-PostHeader">
    " rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
    <?php the_title(); ?>

    </h2>
    <div class="art-PostContent">

    <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>
    <?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>

    </div>
    <div class="cleared"></div>

    </div>

    <div class="cleared"></div>
    </div>
    </div>

    <?php comments_template(); ?>
    <?php endwhile; endif; ?>

    </div>
    <?php include (TEMPLATEPATH . '/sidebar1.php'); ?>
    </div>
    <div class="cleared"></div>

    <?php get_footer(); ?>

  2. Peter Boosten
    Member
    Posted 2 years ago #

    Hard to say since the code has been mangled a bit (tip: use pastebin next time to post some code, but my bet would be the include statement.

    Peter

  3. henkholland
    Member
    Posted 2 years ago #

    The page template should start with:

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

    Are you missing the start <?php ?

  4. luceylin
    Member
    Posted 2 years ago #

    Thanks. I just redid the templates and I am good. I think I started with a one column template page in my theme, and then added a two column page template, but since there was no sidebar template in the main (one column) template I think that is what caused the problem. I am going to start with a two column theme, and add a new page template to that one that just has one column.

    I know what to add at the top (been there done that, as they say) but am not sure if need to delete the include statement for my one page template.

    Also, for my own learning, when there is an error message that refers to a specific line in code, what counts as a line? Every line that has code on it or the blank lines too. (I know REALLY stupid question, but I am a TRUE novice at this--learning quickly but missing some of the basics, I think.

    Thanks very much for your help.

  5. henkholland
    Member
    Posted 2 years ago #

    I use one special page template myself, a wide one. It is copied from page.php with header and footer but I left out <?php include('right_sidebar.php') ;?> amd it has it's own css statement for making it wider. (I use fixed width).

Topic Closed

This topic has been closed to new replies.

About this Topic