0

I use "insert more tag" insert more tag for a post. It works fine, at front page show excerpt, at single page show full content. but at archive page show excerpt, I want show full content here. Here is the code in archive page.

<?php query_posts('cat=1&paged='.get_query_var('paged'));?> 
<?php if (have_posts()) : while (have_posts()) : the_post();?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">      
<?php the_content(); ?>
.........

no idea what's the rule for show full content or excerpt.

  • 1
    Some questions. 1. Why do you use your own query_posts call on archive page? 2. Why do you use "insert more tag" if you want to show all posts and not excerpt? – Krzysiek Dróżdż Jun 21 '13 at 10:01
  • 1.I don't too much about code, just copy somewhere. Basic i want show posts from one category. 2. I want show excerpt at front page and rest of pageS show full content. – James Xu Jun 21 '13 at 10:04
1

When there is <!--more--> tag inserted in post, this post will be truncated on lists pages.

You can use global $more variable to make WordPress think it's single page though. Here is your modified source:

<?php query_posts('cat=1&paged='.get_query_var('paged')); ?>
<?php global $more; $prev_more = $more; $more = 1; if (have_posts()) : while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <?php the_content(); ?>
    ...
<?php endwhile; endif; $more = $prev_more; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.