• Chaz

    (@eternalskychaz)


    Hello, again!

    I am having a possible problem whereby my WP 2.0.2 is displaying Pages as if they were Posts, complete with a Post title and timestamp and footer. It also displays an open comment form.

    Has anyone else had this problem? If so, how do I fix it?

    I’d like to just create a basic page with an opening blurb about the site and some nav controls in a sidebar-like area to act as Home page

    Btw, I’ve been to the Codex page on Pages and I don’t see the button at the bottom of my Write Page Admin Panel to change which Page template this page could use.

    Is this another bug or was there some setting I haven’t checked yet to make this appear?

    Thanks,

    Chaz

Viewing 12 replies - 1 through 12 (of 12 total)
  • ladydelaluna

    (@ladydelaluna)

    That’s not a bug – and it’s not a “problem”… that’s the way WP sets up everything.

    Pages are pages, posts are posts. Pages are called in with a page template, and it’s possible to create a new one that is missing the elements you don’t want.

    The only way to remove it is to go to your page template (depends on your theme what it’s called) and remove the part for comments, and for your date/time stuff.

    Again, not a bug or “issue” – it’s the theme (and just about all of them do it that way).

    moshu

    (@moshu)

    Presumably you don’t have any Page templates in your theme, so the index.php is used to display your Pages. See Template_Hierarchy.
    Create a Page Template by saving your index.php as page.php and edit out whatever you don’t need.
    If you make additional Page templates (see the method at the link above) the dropdown to choose templates during the creation of new Pages will appear.

    Thread Starter Chaz

    (@eternalskychaz)

    Ahhhhh … thank you very much, ladydeluna & moshu. I’ll research all that tonight.

    Thread Starter Chaz

    (@eternalskychaz)

    Okay, moshu, I’ve done as you said, but I am getting a weird error from all my page templates (I built 3 just to make sure) when I try to display the page:

    Parse error: parse error, unexpected $ in {path to WP}/html/wordpress/wp-content/themes/ESky2/page3.php on line 27

    and this is line 27:

    <?php get_footer(); ?>

    and there is nothing else. There is no line 28, no whitespace, nothing.

    Any clues about what might be causing this error even though there’s no $ in the code?

    Here’s the link to my site:

    http://www.eternalsky.us/chronicles/

    The only page listed is the page in question.

    moshu

    (@moshu)

    Unless I see the code in your Page templates it is difficult to say.
    Just for clarification: page.php – which should be the default Page template doesn’t have to have anything on the top.
    ALL the other Page templates need some lines described in the Page Templates sections on their top.
    Are your templates conform to this rules?

    Rok

    (@rok)

    It is not necessary that error will be on line 27, just check lines prior & later to 27. And see, if any opening /closing { } are left alone. If yes, then try to correct the syntax or disable that code and see what happens?

    Thread Starter Chaz

    (@eternalskychaz)

    moshu,

    Yes, my default Page Template has no description at the top. Here’s the code for the page template I am using. it is basically just the same thing as index.php with the lines of code for copyright and comments removed and the descriptive comments placed at the top:

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

    <?php get_header(); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class="post">

    <h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>

    <!--
    <?php trackback_rdf(); ?>
    -->

    </div>

    <?php endwhile; ?>

    <?php get_footer(); ?>

    ladydelaluna

    (@ladydelaluna)

    chaz – you’re missing the content divs… and the template path include… <?php include (TEMPLATEPATH . '/page3.php'); ?>

    here’s what one of mine looks like:

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

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <?php include (TEMPLATEPATH . '/aboutright.php'); ?>

    <div id="content">
    <div id="page">
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <h1><?php the_title(); ?></h1>

    <?php the_content('<p class="serif">Read the rest of this page &raquo;
    '); ?>

    <?php link_pages('<strong>Pages:</strong> ', '
    ', 'number'); ?>

    <?php endwhile; endif; ?>
    </div>

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

    moshu

    (@moshu)

    Hmmm. If there is no different header, sidebar, whatever included – no need for TEMPLATEPATH thingy.
    However, the IF has to be closed!
    Chaz, your template closes only the “while” and leaves the “if” open:
    Yours:
    <?php endwhile; ?>
    In lady’s example:
    <?php endwhile; endif; ?>

    ladydelaluna

    (@ladydelaluna)

    thanks moshu – i forgot that i have different sidebars in mine 🙂

    Thread Starter Chaz

    (@eternalskychaz)

    Thanks, moshu. Closing the endif; seems to have gotten rid of that error.

    lady,

    Actually, none of the themes I have downloaded use have that TEMPLATEPATH command, most likely because any templates at all are taken directly from the theme folder. So there is no need to define an alternate path to a template, unless a blogger is storing all their page templates together in a separate folder.

    And, yes, I do have content divs:

    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>

    I just left it at 3 lines instead of compressing it into one line, like yours. 😉

    The one real difference with your page is the separate id="page" Page div you are using and, once again, that item seems to be missing from the code of the Page templates in the themes I downloaded for use.

    ladydelaluna

    (@ladydelaluna)

    Chaz – I started with WPAndreas-09 – It had a template for a 2 column page with a left sidebar built into the page (which I have never used), and a 3 column page with content in the middle (of course, an extra sidebar). I took the 3 column page I was given by default, and saved it up as 5 different page templates, calling in 5 different sidebars. So when you go to one “Category” of pages you get one kind of right sidebar, and another “category” gives you a different sidebar. ALL my pages and sidebars and all are in the same folder… “TEMPLATEPATH” line is calling in my right hand sidebar for the about page in that example (which is the about page template).

    Maybe my theme is more complicated, I have no idea… that’s just what I’ve done, it works, it validates, I’m happy. LOL

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Pages displayed as posts’ is closed to new replies.