Support » Themes and Templates » Page.php Problem

  • Resolved shanesque


    I’m currently working on my page.php for my own theme. I want my pages to have comment forms. The problem is that when I add <?php comments_template(); ?> to the page. The results is this (problem). It appears that nothing is wrong but I have a plugin which tells how many comments each entry has. For this particular page there are NO comments but the comment number for my blog is showing up in the page template. This is my page template:<br>
    <?php require_once(“/home/intricat/public_html/wp-blog-header.php”);?><?php get_header(); ?>
    <div id=”content” class=”narrowcolumn”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <div class=”entrytext”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>
    <?php comments_template(); ?>
    <?php link_pages(‘<p>Pages: ‘, ‘</p>’, ‘number’); ?>

    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    <?php get_sidebar(); ?><?php get_footer(); ?><br>
    How can I get my page template to stop displaying comment counts from my blog?

Viewing 12 replies - 1 through 12 (of 12 total)
  • You need to edit that code section, use backticks to surround the code (the oddball symbol under the tilde – the other oddball symbol – on the key to the left of the numeral one key on English keyboards) – repaste the entire code section using the backticks this time, or paste it to, and post the link back here.

    I don’t understand what you mean…

    <?php get_header(); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="storytitle"><b><?php the_title(); ?></b> <?php the_time(' F jS Y ',true); ?></div>
    <div class="storyinfo"><img src="/wp-content/themes/frequencies/images/book.gif" align="middle" hspace="2"> <?php _e('Filed under'); ?>
    <?php the_category(', ') ?> <img src="/wp-content/themes/frequencies/images/clock.gif" align="middle" hspace="2"> <?php the_time() ?> <img src="/wp-content/themes/frequencies/images/pencil.gif" align="middle" hspace="2"> &nbsp; <b><?php echo(str_word_count(get_the_content())); ?></b> Words in Post</div>
    <div class="post">
    <?php wp_link_pages(); ?>
    <?php the_content(__('Read the rest of this entry')); ?>
    <?php comments_template(); ?>
    <?php endwhile; else : ?></div>
    <h2><?php _e('Not Found'); ?></h2>
    <?php _e('Sorry, but the page you requested cannot be found.'); ?>
    <h3><?php _e('Search'); ?></h3>
    <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    <?php endif; ?>
    <?php get_sidebar(); ?><?php get_footer(); ?>

    Do you mean like this?

    Just put it at pastebin please (link above) and then put the link here.

    [just a technical note: if there is a blank line in the code in between the backticks ` – that breaks the “magic” 😉 ]

    And here is what you need for a Page template inside the WP theme folder:

    (it seems your “template” is outside of WP since it has to have this:
    – in this case I’d avoid calling it page.php – that filename is on the list of special template files)

    Yes, like that. And thanks for the pastebin link too (which keeps the indents in the formatting – easier for me to read that way).

    I don’t see anything in there that would cause what your screenshot does. However, trying to troubleshoot with a screenie is useless. Could you provide a real link to the problem?

    [Ah. Missed that, mosh’!]

    Even using that template page WP tut, I’m still getting the same results. I took the require once bit out and put just the header include. Still the same results.

    That’s what my template page looks like.

    I’m thinking maybe something is wrong with my comments template which is causing the problem but I’m not really sure.

    That’s not the template – it is the plugin as you said in your OP (original post). Don’t use the plugin if it conflicts with your Page design ideas 🙂

    Yeah you’re right, both of those plugins were conflicting with my theme, I solved the problem now, thanks to the both of you.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Page.php Problem’ is closed to new replies.