• I need a menu that displays say 5 links. When clicked, the links should lead to the latest post in one category.

    Tha means that my page will seem to only contain 5 posts at any time. (it’s meant to be a magazine, so last weeks news is not very important)

    What I have done is to make templates for my categories. One for each category, and then again made pages base don these templates. The templates is supposed to only get one post pr category.

    The code:
    <?php
    /*
    Template Name: ”Sport” – will get me lastest post from ”sport category”
    */
    ?>

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    <div id="content" class="widecolumn">

    <!-- category 1 is sport -->
    <?php query_posts('cat=1&showposts=1'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <?php if ( in_category(1) ) { ?>

    <div class="post" id="post-<?php the_ID(); ?>">
    <h2>" rel="bookmark" title="Permanent lenke: <?php the_title(); ?>"><?php the_title(); ?></h2>
    <div class="entrytext">
    <?php the_content('<p class="serif">Les resten av dette innlegget »</p>'); ?>

    <p class="postmetadata alt">
    <small>
    Published..

    <?php the_time('l j. F Y') ?> time.. <?php the_time() ?>
    filed under <?php the_category(', ') ?>.
    rss<?php comments_rss_link('RSS 2.0'); ?>.
    <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    // comment open?
    leave legge comment or " rel="trackback">trackback.

    <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    // only pinkback
    sorry, only " rel="trackback">pinback.

    <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    // comments open, no pingback
    Only comments..

    <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    // no interacting..
    all commenting closed

    <?php } edit_post_link('edit.','',''); ?>

    </small>

    </p>
    </div>
    </div>

    <?php comments_template(); ?>

    <?php } else {
    }; ?>

    <?php endwhile; ?>

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

    i use this code to make a page ”sports”. The problem is that
    <?php comments_template(); ?>
    doesn’t do anything.
    The page works, and fetches what is should, but he commenting doesn’t work. doesn’t show up at all. why?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Make a page from template, alow comments.’ is closed to new replies.