I hope there are some wordpress users on this forum and could provide me some guidance.
This code belows works on an archive page (it would display post content up to the <--more--> tag then put a link to see rest of the post). When I put it in one of my custom pages that function doesn't work. The full post would be displayed. Why? The only difference between my custom.php page and the default archive.php page is that custom.php is declared as a template (Template Name: blah) and could be chosen to be the template when one creates a new page. archive.php is automatically called by Wordpress when you click on a chronological archive link and it is not a template.
<?php
/*
Template Name: Custom Template
*/
?>
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2 class="pagetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2 class="pagetitle">Blog Archives</h2>
<?php } ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="meta">
<?php _e("Filed under:"); ?>
<?php the_category(',') ?> —
<?php the_author() ?> @ <?php the_time() ?>
<?php the_date(); ?>
<?php edit_post_link(__('Edit This')); ?>
</div>
<div class="storycontent">
<?php if(is_category(21) || is_archive()) {
the_content('more...');
} else {
the_content();
} ?>
<?php //the_content(__('(more...
)')); ?>
</div>
<div class="feedback">
<?php wp_link_pages(); ?>
<?php comments_popup_link(__('Co
mments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
</div>
</div>
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next Entries »') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
<?php endif; ?>