WordPress.org

Forums

jQuery Comment Replies
[resolved] replace text with image (5 posts)

  1. mauriciomesquita
    Member
    Posted 2 years ago #

    Hello

    First, thanks for the plugin! It's really good

    How do I replace "Show Replies" and "Hide Replies" for images? I'm not a great programmer and am having difficulty.

    Thanks
    Mauricio

    http://wordpress.org/extend/plugins/jquery-expandable-comments/

  2. mauriciomesquita
    Member
    Posted 2 years ago #

    For those who want to put a static image, simply remove the line

    $(this).text( $(this).text().innerHTML==

  3. Doodlebee
    Member
    Plugin Author

    Posted 2 years ago #

    Hi mauriciomesquita,

    I was away on a family emergency last week, but I saw your question on my site. I'll repeat what I said over there:

    "Do you mean how to replace the text with an image?

    Open up “jQuery-comments.php”, and around line 35, look for function start_lvl(&$output, $depth, $args) {

    That's the function that has the text ("Show Replies" and "Hide Replies") for the expansion trigger. Just replace the text with the image call. You have to make sure the image path is correct, too (relative paths don’t work, unless you upload the image in the plugin directory).

    This sounds like perhaps I should make an option page, to edit the text and/or use an image? I could do that for a future release… thanks for the idea!"

    Your idea might be better in a separate functions.php file - that way you don't have to edit the core plugin file (and thus have it overwritten when I update it).

  4. mauriciomesquita
    Member
    Posted 2 years ago #

    Hello, thanks for the help! The plugin is fantastic, very smart.

    This function is the "starting point" the text "Show Replies". And I realy can replace "Show Replies" for a image!

    But, in practice, when I click on the image to expand comments and display the responses appears the text "Hide Replies". And clicking again appears the text "Show Replies" and not the image.

    This text is in line 275:

    $(this).text( $(this).text() == 'Show Replies' ? 'Hide Replies' : 'Show Replies');

    However, replace this text for the image code displays the image code rather than the image itself.

    sorry my english, I'm brazilian
    Thanks again
    Mauricio

  5. Doodlebee
    Member
    Plugin Author

    Posted 2 years ago #

    Ah! Yes. You're correct - thanks for pointing that out.

    I do like this idea though - I'll definitely incorporate this into the next release, so you can easily change this sort of thing. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.