Forums

Remove link from comment dates? (5 posts)

  1. johnasp
    Member
    Posted 2 years ago #

    Firstly, can I ask why does WordPress add an anchor tag around the date/time stamp for user comments?

    And secondly, how do you remove this link? I can't find anywhere obvious to do this.

    Cheers

  2. songdogtech
    Member
    Posted 2 years ago #

    WordPress doesn't add that; theme authors do. In your theme files - like index.php, single.php, etc. - look for something like:

    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>

    But the exact format of any comments link will depend on your theme.

  3. johnasp
    Member
    Posted 2 years ago #

    Ah right got it thanks. What woud someone want to create an anchor around the date, just out of interest? I dont get why they would add a link around the date/time of post.

  4. kalibahlu
    Member
    Posted 1 year ago #

    I have this same question... I found that line of code, but it doesn't seem to effect the link in the comment dates. I don't mind it there if seemed to have a purpose, but I can't figure out what the purpose might be. Anyway, does anyone know how to remove the anchor tags from the comment dates in Kubrick? Thanks!

  5. kalibahlu
    Member
    Posted 1 year ago #

    OK, figured it out... In my case I had to find this:

    <date class="comment-meta commentmetadata">
            <a href="<?php echo htmlspecialchars( get_comment_link(
            $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at
            %2$s'), get_comment_date(),  get_comment_time()) ?></a>
            <?php edit_comment_link(__('(Edit)'),'  ','') ?>
          </div>

    and just take out the anchor:

    <date class="comment-meta commentmetadata">
            <?php printf(__('%1$s at
            %2$s'), get_comment_date(),  get_comment_time()) ?>
            <?php edit_comment_link(__('(Edit)'),'  ','') ?>
          </div>

    I would like to change this post to 'resolved', but the option is gone now. Oh well, it probably differs a lot from theme to theme anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic