WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I display a comment_excerpt and a link to full comment text? (5 posts)

  1. Nagore
    Member
    Posted 4 years ago #

    Hi,
    I am trying to display only comment excerpts under my posts and I would like to add a link after each excerpt to read the full comment text.

    I haven't found any information anywhere about this, so I'm starting to think that it is either really easy or is not possible.

    Any clues about this anyone?
    thanks,

    nagore

  2. Samuel B
    moderator
    Posted 4 years ago #

  3. Nagore
    Member
    Posted 4 years ago #

    Hi,
    Thanks for the response.

    That's where I was looking and I'm using that but it's not giving me a link. I guess I must be putting it in the wrong place.
    I replaced the comment_text() function in the comment.php template.
    It shows the excerpt but no link, that way.

    If i put it in the page.php template instead of comments_template()
    it doesn't show anything.

    So I'm confused.
    Sorry, I must be missing something very obvious.

    thanks

  4. Nagore
    Member
    Posted 4 years ago #

    Hi,
    I still haven't found a solution...

    Am I right thinking that comment_excerpt() should provide a link by itself? It doesn't work like that for me? What am I doing wrong?
    Is it wrong to replace it for comment_text() in the comments template?
    I saw some code where someone put <?php comment_excerpt(); ?><?php comment_text(); ?> one after the other. It didn't make much sense to me but I tried and it just displays the whole text of the comment after the excerpt of the comment. Not good.

    Can anybody help me? I'm afraid I don't now enough about programing to figure out what's happening here.

    any advice would be very appreciated.
    (please)
    n.

  5. saucemaster
    Member
    Posted 4 years ago #

    Nagore, I had this same problem, I could find plenty of tags for comment id or comment excerpt, but nothing for a 'comment link' or 'comment url'.
    here's something i put together for a page with a list of posts and a list of latest comment for each post; there is a comment excerpt and a link to that comment on the post's page.

    <a href="<?php the_permalink() ?>#comment-<?php comment_ID() ?>" title="link"> <?php comment_excerpt(); ?></a> <br /> by: <?php comment_author_link(); ?>

    you can see an example of it on this page.
    http://www.sisyphean.com/tag/roosevelt/

    i hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic