WordPress.org

Ready to get started?Download WordPress

Forums

Replacing comment text with an image? (6 posts)

  1. shadow
    Member
    Posted 9 years ago #

    Can anyone tell me how you go about replacing the text 'Comments' with a linking image instead?
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

    Thanks if you can help :)

  2. Kafkaesqui

    Posted 9 years ago #

    <?php comments_popup_link('<img src="/path/to/nocomment.jpg" />', '<img src="/path/to/onecomment.jpg" />', '<img src="/path/to/manycomments.jpg" />'); ?>

  3. shadow
    Member
    Posted 9 years ago #

    Thanks Kafkaesqui - much appreciated :)

  4. chiensavant
    Member
    Posted 9 years ago #

    May I suggest you to also add the alt attribute for validation purposes ?

    Something like
    <?php comments_popup_link('<img src="/path/to/nocomment.jpg" alt="No comment" />', '<img src="/path/to/onecomment.jpg" alt="One comment"/>', '<img src="/path/to/manycomments.jpg" alt="Many comments"/>'); ?>

  5. shadow
    Member
    Posted 9 years ago #

    A good suggestion chienservant :)

    Already added - thanks :)

  6. pepster
    Member
    Posted 8 years ago #

    hey cool. i have the same problem now.

    the thing is, the image i want is in my theme directory. i tried using <?php bloginfo(stylesheet_directory); ?> inside <?php comments_popup_link...> like this:

    <?php comments_popup_link('<img src="<?php bloginfo(stylesheet_directory); ?>/icons/comments.png">, (and so on...)

    but it doesn't work. any ideas? :D

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.