WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Page.php Problem (13 posts)

  1. shanesque
    Member
    Posted 7 years ago #

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

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

  2. vkaryl
    Member
    Posted 7 years ago #

    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 http://wordpress.pastebin.ca, and post the link back here.

  3. shanesque
    Member
    Posted 7 years ago #

    I don't understand what you mean...

  4. shanesque
    Member
    Posted 7 years ago #

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

  5. vkaryl
    Member
    Posted 7 years ago #

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

  6. moshu
    Member
    Posted 7 years ago #

    [just a technical note: if there is a blank line in the code in between the backticks ` - that breaks the "magic" ;) ]

  7. shanesque
    Member
    Posted 7 years ago #

  8. moshu
    Member
    Posted 7 years ago #

    And here is what you need for a Page template inside the WP theme folder:
    http://codex.wordpress.org/Pages#Page_Templates

    (it seems your "template" is outside of WP since it has to have this:
    require_once("/home/intricat/public_html/wp-blog-header.php
    - in this case I'd avoid calling it page.php - that filename is on the list of special template files)

  9. vkaryl
    Member
    Posted 7 years ago #

    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'!]

  10. shanesque
    Member
    Posted 7 years ago #

    http://www.intricate-life.com/?page_id=9

    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.

  11. shanesque
    Member
    Posted 7 years ago #

    http://wordpress.pastebin.ca/314861

    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.

  12. moshu
    Member
    Posted 7 years ago #

    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 :)

  13. shanesque
    Member
    Posted 7 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic