Customize comments popup link (images)
-
Hello. I’m trying to insert images in my comments_popup_link, so under the entry won’t be written “Comment”, but some picture could be seen instead.
I’m hopeless in php, but using logic and this post, I managed to write this:<?php $leavecomment='<img src="' .TEMPLATEPATH . '/leavecomm.gif" width="134" height="23" alt="Leave comment" align="middle" style="padding-bottom: 9px;" border="0" />';
$onecomment='<img src="' .TEMPLATEPATH . '/comm.gif" alt="Comments: 1" width="90" height="23" align="middle" style="padding-bottom: 9px;" border="0" /> 1';
$quancomment='<img src="' .TEMPLATEPATH . '/comm.gif" alt="Comments:" width="90" height="23" align="middle" style="padding-bottom: 9px;" border="0" />';
comments_popup_link($leavecomment,$onecomment,$quancomment); ?>
The problem is that TEMPLATEPATH creates absolute path (/home/public_html/…), so the path to images is absolute and of course images don’t appear. I’ve tried to use
bloginfo('template_directory');
, but php-code doesn’t work.
And the second problem: I don’t know how to display quantity of comments this way – like “Comments 5” with images: “IMG 5”Hope my english is understandable. ^^
- The topic ‘Customize comments popup link (images)’ is closed to new replies.