Support » Themes and Templates » Comments Tag

  • Hi. I asked this last night in IRC and I got it to work then I realised that if you use a differnet style then you have the same image and that isn’t cool if you want a non-naughty version. 😉
    Anyway, where the links for comments go I put an image instead and then it spits out how many comments. What I would rather do is depending on the stylesheet, a differnet image or it to actually say “comments here” if I don’t want to put in an image?
    Amd I making any sense?
    Thank you. =)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Tek, it’s possible. Your going to have to write some php code to do it though.
    If your not php fluent, you might want to consider putting in a plugin request – for something similar. Might be a bit messy as a plugin though.
    What your asking is to have the style sheets effect the actual code in your index.php file, which really isn’t what they do at all.
    Now in your style sheet you could specify a style for comments that includes a background image. Then in your index.php file, where you want it to have something like:
    <div id="comments">
    Of course, this will display the same image for no comments as well as comments having already been posted.
    Heh, possibilities are endless. Personally I’d probably aim for a php solution that examines what style sheet is currently being used.

    Thanks for the explanation, unoamigo.

    I’m not sure if I understand you completely here…
    Do you want to have a separate picture for however many posts there are? (Ie. the picture for 5 and 16 posts wouldn’t be the same)
    That would require quite a bit of PHP’ing, methinks, and I have no idea what/where/how to do it…
    But if you’ll settle for having three pictures – one for 0 comments, one for 1 comment and one for >1 comment – it’s quite simple: Simply exchange the strings in the wp_comments_popup() call in your index.php file. Ie. change
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    <?php comments_popup_link(__('<img src="imgfornoposts.jpg">'), __('<img src="imgforonepost.jpg">'), __('<img src="imgformoreposts.jpg">')); ?>
    I haven’t actually tried it, but it should work, since HTML formatting of the string does.

    No… what I mean is this:
    Okay right now, it says comments(1)
    But lets say I do a fourth of july theme… I want there to be an image of a star then (1) but lets say someone HATES my fourth of july skin and want to use the default, then the default has say a picture of a bananna and (1) but someone else loves the tedddy bear skin so there is a picture of a honey pot and (1)

    How can I create a section on my site to display the last 10 comments posted? Thank You

    Get the recent comments hack or one of the others that can display ’em.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Comments Tag’ is closed to new replies.