WordPress.org

Forums

Comments Tag (7 posts)

  1. Tek
    Member
    Posted 11 years ago #

    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. =)

  2. unoamigo
    Member
    Posted 11 years ago #

    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.

  3. Tek
    Member
    Posted 11 years ago #

    Thanks for the explanation, unoamigo.
    =)

  4. Oisin
    Member
    Posted 11 years ago #

    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 (%)')); ?>
    into
    <?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.

  5. Tek
    Member
    Posted 11 years ago #

    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)
    See?

  6. Anonymous
    Unregistered
    Posted 11 years ago #

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

  7. Beel
    Member
    Posted 11 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.