Forums

Different comment forms from different category templates (1 post)

  1. tinkerdomino
    Member
    Posted 3 years ago #

    I have been struggling with this for some time.

    I am using wordpress more as CMS, and so modified my comment form wording from "leave a reply" to something more suitable (example: http://www.quaggabooks.co.za/featured-items/darwin-and-after-darwin-an-exposition-of-the-darwinian-theory-and-a-discussion-of-post-darwinian-questions-3vols)

    I also have 2 extra category templates (for featured items and Newsletter).
    I would like Newsletter to have a different comment form to the customised one that I have for other sections of my site. But no matter what I do, the wording will not change, it remains "leave a reply".

    This is what I did:
    I created a template for the category: category-62.php. This works perfectly.
    Following tips in the forum, then changed single.php to contain only:
    '<?php
    if (in_category('62')) {include (TEMPLATEPATH . '/single_news.php');
    }
    else { include (TEMPLATEPATH . '/single_normal.php');
    }
    ?>'

    I then created single_normal.php and single_news.php which currently reads as follows and calls commentsnews.php:
    '<?php
    /*
    Template Name: Single News
    */
    ?><?php get_header(); ?>

    <div class="main">

    <div class="content">

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">

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

    <div class="entry">

    <?php the_content('Read the rest of this entry »'); ?>
    <?php the_meta(); ?>

    </div>

    <p class="info">Posted in <?php the_category(', ') ?><?php edit_post_link('Edit',' | ',''); ?></p>

    </div>

    <?php comments_template(commentsnews.php); ?>

    <?php endwhile; ?>

    <p align="center"><?php next_posts_link('« Previous Entries') ?> <?php previous_posts_link('Next Entries »') ?></p>

    <?php else : ?>

    <h2 align="center">Not Found</h2>

    <p align="center">Sorry, but you are looking for something that isn't here.</p>

    <?php endif; ?><?php if (function_exists('sociable_html')) {
    echo sociable_html();
    } ?>
    </div>

    <?php get_sidebar(); ?>

    <div class="clearer"><span></span></div>
    </div>

    <?php get_footer(); ?>'

    Comments_news.php is exactly the same as comments.php, but with different wording (Please comment on this article). Eg: http://www.quaggabooks.co.za/newsletter/march-2009-newsletter-on-the-origin-of-species

    But it does not work. I am sure I am doing something really stupid, but i just can't see what! Please help.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags