How to add a image style to an image in a template file? I need to change these lines (belong to a tpl.php file) to include a image style called "adaptative_image_style" to the generated image.

&lt;?php print l(theme('image', $image_attributes), $ad['url'], $link_attributes); ?&gt;


I think I should use the function to theme_image_style($variables) instead but not sure how to implement it.

Based in Clive's answer I get it working with this code:

  &lt;?php 
  $image_attributes['style_name'] = 'adaptative_image_style';
  print l(theme('image', $image_attributes), $ad['url'], $link_attributes); ?&gt;
The docs page has it pretty much covered but here's an example if you're struggling:

$style_vars = array(
  'style_name' =&gt; $style_name,
  'path' =&gt; $image_path,
  'alt' =&gt; $alt_text
);

$image = theme('image_style', $style_vars);

$link = l($image, $url, array('html' =&gt; TRUE));