Hi there,
I have a piece of code below tht displays latest comments. However, when i click on the link it takes me to 'site.com/blog/archives/1' for all the links even though they are from different sources.
Any ideas where im going wrong?
<?php
$comments = get_comments('status=approve&number=5');
foreach($comments as $comm) :?>
<a href="<?php the_permalink(); ?>" title=xx"><?php echo($comm->comment_content);?></a>
<?php endforeach;?>
</div>
I think you may need to use something like echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) instead of the_permalink()
Mike
How would that work with the above code?
If you still haven't solved this, try this code:
<?php
$comments = get_comments('status=approve&number=5');
foreach($comments as $comm) :?>
<a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ); ?>" title=xx"><?php echo($comm->comment_content);?></a>
<?php endforeach;?>
</div>
Mike