Cool, I'm glad you found that the other plugin was using the same class name before I tried to figure it out.
So don't touch the Gravatar plugin. Instead change all the instances of 'avatar' in the script with something else. In the code below I changed it to 'pic2col', hopefully that won't conflict with anything else.
I guess the code just looks for anything named avatar and not necessarily and alt of avatar?
The second part of the script was looking for anything with the class 'avatar' so changing that to something super specific will work fine.
One thing I would do is move the script below all the existing CSS links in your head tag. That way it will over write the existing when the script fires.
Here's an example of how it can work:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<style type="text/css">
.post {
width: 600px;
border: 1px solid #000;
position: relative;
}
.post p {
padding: 4px 8px 18px 8px;
margin: 0;
}
.post img {
float: left;
display: inline;
margin: 4px 8px 4px 8px;
}
.post_col_r {
width: 0px;
float: left;
}
.post_col_l {
width: 600px;
background: #eee;
}
</style>
<script src="jquery/jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.post img').each(function(index){
if ($(this).attr('alt') == 'pic2col') {
$(this).addClass('pic2col');
}
})
if ( $('.pic2col').length > 0 ) {
$('head').append('<link rel="stylesheet" href="pic2col.css" type="text/css" />');
}
});
</script>
</head>
<body>
<div class="post">
<div class="post_col_r">
</div>
<div class="post_col_l">
<!-- ** this is where your loop goes ** -->
<!-- below is sample output from the loop -->
<img src="120x120.gif" alt="" />
<p>Duis condimentum, tortor et tristique fermentum, dui eros feugiat turpis, vel elementum nibh ante ut sem. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec sed ipsum est, sed facilisis enim. Etiam arcu augue, scelerisque vitae fermentum eu, condimentum nec leo.</p>
<p>Praesent malesuada, purus in dapibus pharetra, lorem nibh euismod augue, id venenatis libero lectus sit amet mauris. Integer rutrum lacus at odio malesuada ac vestibulum leo consectetur. Phasellus posuere velit a neque gravida at iaculis odio lobortis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.</p>
<img src="120x120.gif" alt="pic2col" />
</div>
</div>
</body>
</html>
Notice I am using a 120px x 120px image as my test image so the CSS dimensions are based on that. Also the link to my jQuery s relative to my test environment so of course you'll need to make sure it points correctly on your side.
By default, WP gives a class of post to the post div. If you have changed that, then change it in the script and CSS accordingly.
So you need to 'position: relative' the .post. That way you can safely 'position: absolute' the image you want to maneuver.
So when the script successfully fires and appends the new CSS, this is the example CSS I used:
.post_col_r {
width: 130px;
float: left;
}
.post_col_l {
width: 460px;
background: #eee;
margin: 0 0 0 140px;
}
.pic2col {
position: absolute;
top: 0;
left: 0;
}
It appears to work fine. Of course you'll need to adjust for your column and image sizes and spacing and what-not.