Adding “Read” More to excerpt…
-
I am trying to add a read more link ot the_excerpt on my home page.
I want to display the latest post from category 1 as well as the editable content for the page.For this I think I am using two loops but can’t get a read more link to come up for my excerpt. What may be going on?
<?php global $post; $myposts = get_posts('numberposts=5&category=1'); foreach($myposts as $post) : ?> <h2> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <?php the_excerpt('Read the rest of this entry...'); ?> <?php endforeach; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="archivearticle"> <div class="title"> </div> <!-- Title div --> <div class="postcontent"> <?php the_content(); ?> <p><?php edit_post_link('Edit This Page', ''); ?></p> </div> <!-- Post content div --> </div> <!-- Latest article div --> <?php endwhile; ?> <div class="pagination"> <div class="alignleft"><?php next_posts_link('« Older Entries'); ?></div> <div class="alignright"><?php previous_posts_link('Newer Entries »'); ?></div> </div> <?php else : ?> <h1>Not Found</h1> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?>
The topic ‘Adding “Read” More to excerpt…’ is closed to new replies.