Bricolou
Member
Posted 7 years ago #
I'm using the excerpt for my archive and category pages and would like to put a "Read this post" link at the bottom of the excerpt without the link showing up when the post is unfolded.
I've got this working: <?php if(is_category() || is_archive()) { echo '<a href="#">Lire la suite...</a>' ; } ?>
But when I put <a href="<?php the_permalink(); ?>"> where the "#" is, it doesn't work.
Sorry to be so daft, but can anyone tell me what I'm doing wrong - I've already pulled out most of my hair!
Bricolou
Member
Posted 7 years ago #
OK, OK, found it!
<?php
if ($single)
the_content();
else {
the_excerpt();
if (!empty($post->post_excerpt))
{
?> </div>
<a href="<?php the_permalink(); ?>">Read this post</a>
<?php
}
}
?>
Thanks to those people in this thread :
http://wordpress.org/support/topic/53855?replies=12
Would be easier if the WP support forum search function was working.
thanks for sharing... I was able to take this and modify it for my custom theme easily.
thanks!