So my home page is set to display according to a template file as per Moshu’s superb Static Frontpage with Dynamic Content tutorial. It is set up to pull only the ‘news’ category posts, using a second loop. Here is the code for the second loop:
<?php $temp_query = $wp_query; ?>
<?php query_posts(‘category_name=news&showposts=8’); ?>
<?php while (have_posts()) : ?> <?php the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”> <div class=”post-title”>
<h3>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_title(); ?></h3>
<p><?php the_content(‘(Read on) »’); ?></p>
<span class=”post-date”><?php the_time(‘l F j, Y’); ?></span>
<span class=”post-comments-home”><?php comments_popup_link(‘No comments yet’, ‘1 Comment »’, ‘% Comments »’); ?></span>
The only problem is that my ‘more’ tags are removed. As I really only want excerpts (but with the ‘read more’ option as opposed to the standard no-linked […] when using the_excerpt), this is frustrating.
<?php global $more;
$more = 0; ?>
Under the template name does nothing, and including it within the php template tags
/*Template Name: Main*/
$more = 0;
breaks it completely. (Bear in mind I’m a novice in PHP, but this was suggested in a tutorial so it ought to work).
Any suggestions on how to fix this please?
- The topic ‘More tag ignored on home page’ is closed to new replies.