• syncbox

    (@syncbox)


    Where it has:

    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>

    I’d like to insert a small graphic instead of the word Comments

    How would one do this? Let’s say, for example, that the regular img path was:

    <img src=”/wp-content/themes/maggieb/sharedimages/icon-comments.png” />

    help greatly appreciated!

Viewing 1 replies (of 1 total)
  • jonocono

    (@jonocono)

    You can either add an image before or after “Comments” or like you’re saying replace the text “Comments” with just the image instead.

    Currently you have:
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>

    To either add an image or completely replace “Comments” with an image, you would want to change it to:
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('<img src="/wp-content/themes/maggieb/sharedimages/icon-comments.png" /> (0)'), __('<img src="/wp-content/themes/maggieb/sharedimages/icon-comments.png" /> (1)'), __('<img src="/wp-content/themes/maggieb/sharedimages/icon-comments.png" /> (%)')); ?>
    </div>

    This will set it so you only have an image for Comments. On my site I actually have to put the full src for the image starting at https://…right to the image name for it to show up. It depends on whether your blog is right in the root folder or if it is in a folder within the root. Test it out, see what happens. Also you may find that you’ll want to include border="0" align="top" inserted between img src. So it would look like <img border="0" align="top src="https://example.com/blog/wp-content/themes/classic/img/comments.gif">

    Hope this helps!

Viewing 1 replies (of 1 total)
  • The topic ‘how to add graphic icon to comments code?’ is closed to new replies.