0
<?php
  $node=node_load(3);
  $theme_img = file_create_url($node->field_theme_image[$node->language][0]['uri']);  //origional image path
  print $theme_img;
?>

I am trying to load an image in "page--front.tpl.php", which was created from a content of node value 3.
Using above code, I am able to get origional image url. But I need path of image created using image style (home_theme)

1

1 Answer 1

0

You can use image_style_url($style_name, $path)

Example:

$img_url = $node->field_image['und'][0]['uri'];
<img src="<?php print image_style_url("thumbnail", $img_url); ?>" />

Where you will be replacing thumbnail with the image style name you have in place

Not the answer you're looking for? Browse other questions tagged or ask your own question.