WordPress.org

Ready to get started?Download WordPress

Forums

ThickBox Content
[resolved] Using an image rather than text for the anchor? (8 posts)

  1. Jeff Hester
    Member
    Posted 3 years ago #

    Is it possible to use an image as the anchor for content rather than simply a text link? Do you have a code example?

    I've looked all over the docs on your website, but couldn't find an answer.

    http://wordpress.org/extend/plugins/thickbox-content/

  2. Jeff Hester
    Member
    Posted 3 years ago #

    Nevermind. I found the solution (replacing the anchor tag and using single quotes).

  3. mattrupp
    Member
    Posted 3 years ago #

    Would you please post a sample of your syntax?

  4. jpswer
    Member
    Posted 3 years ago #

    I've recently been trying to do the same thing. The syntax I use is for example:

    `[thkBC id="205" height="600" width="600" anchortext='<img src="http://www.blah.blah" width="162" height="154"' />

    You can put any HTML within the single quotes in the anchortext tag and it will render it as a link to the thickbox.

    Hope this helps...

  5. jadenoel
    Member
    Posted 3 years ago #

    What am I doing wrong? I've tried doing the html img tag in single quotes within the anchor text area, and no matter what I tweak, the image won't display. Instead, this text displays as the link:

    ThickBox Content Link

    I don't know where that text is even coming from. Here is the code I'm using:

    '[thkBC id="181" anchortext="'<img src="http://pramlaos.org/wp-content/uploads/img/studentproj1.jpg" alt="" width="160" height="120" />'" title="Animal Health" url="http://pramlaos.org/wp-content/uploads/img/Laos_map_poor_sm.jpg" type="iframe"]'

    Can someone please tell me what I'm doing wrong?

  6. jadenoel
    Member
    Posted 3 years ago #

    I fixed it by going into the HTML and taking out the double quotes around the anchortext (<img />) content, so like this:

    [thkBC id="181" anchortext='<img src="http://pramlaos.org/wp-content/uploads/img/studentproj1.jpg" alt="" width="160" height="120" />' title="Animal Health" url="http://pramlaos.org/wp-content/uploads/img/Laos_map_poor_sm.jpg" type="iframe"]

  7. Max Chirkov
    Member
    Plugin Author

    Posted 3 years ago #

    @jadenoel - yes, the quotes will get into a conflict by canceling each other out if they are the same. So, if for example parameter anchortext=" " users double quotes, then you have to use single quotes within it, or vice versa - single quotes on the outside and double inside.

  8. xroox
    Member
    Posted 3 years ago #

    Thanks this helped me out. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic