It would help to know how the images/links are being called on the page. I assume they’re not hand-coded into your template, so is it a plugin or script, or rather one of the regular link tags in WordPress?
If the last, one possibility is my Add Link Attribute plugin:
http://guff.szub.net/add-link-attribute
Does Amazon allow direct linking like that? Many sites do not…just asking.
Also, when you create your link, you can define your own height and width values and the image will be resized to fit.
<img src="http://example.com/image.jpg" height="80px" width="80px" />
Thread Starter
Ronny
(@ronny)
Kafkaesqui yeah i’m trying to find a way of using the Link manager in wordpress to do it, as opposed to hard coding it. Your Add Link Attribute plugin sounds like just the thing.
i tried it out but it didn’t quite work.
i used this
<code><li id="Reading List"><?php _e("Reading List:"); ?>
<ul>
<?php add_link_attr("wp_get_links", "3", "height="60" width="39""); ?>
</ul>
</li>
thanks.
Ronny
Ronny,
Yeah, as should be evident from the plugin’s name, it’s dedicated to “link” attributes. My suggestion to use this came after a long day and no sleep, so not too strong in my reading comprehension.
However, give me a few and I’ll add a new argument to the plugin that’ll let you pass attributes to img tags…
Ok, Add Link Attribute is now img-aware:
http://guff.szub.net/add-link-attribute
Just upload the new version over your current one; shouldn’t need to activate, etc. Once you have the new version, here’s how your code will look:
<li id='Reading List'><?php _e('Reading List:'); ?>
<ul>
<?php add_link_attr('wp_get_links', '3', 'height="60" width="39"', true); ?>
</ul>
</li>
Note the true value at the end of the parameter list. It’s setting the new imgtag boolean argument to *on*, and will pass your attributes to the <img> instead of the <a> tag.
Thread Starter
Ronny
(@ronny)
wow thanks for remaking the plug in for me.
unfortunately i tried it out and it didn’t work.
i did notice however that in the plug in manager area of wordpress it states Add Link Attribute plugin as version 0.1 even though i downloaded overwrote, deactivate reactivated etc.
hmmm…any ideas?
thanks again.
Ronny
Deactivate Add Link Attribute, delete the plugin, upload the new one (take a look at it in a text editor to make sure the Version: line says 0.2), and reactivate. From then on it *should* work.
Thread Starter
Ronny
(@ronny)
ok kaf… er… i don’t think the one available for download on your website in version 0.2 because i’ve tried downloading several times and its always 0.1 might want to look in on that. thanks.
Thread Starter
Ronny
(@ronny)
ok thanks kof. got it working just the way i wanted it.
Ronny.
It worked for me too! Just what I wanted! But, for the newbies like me, the changes must be done on your sidebar.php theme file.