i have just cloned my website and then updated the cloned website. Everything works perfec except the images for my sub categories isnt showing up, my product images are just not the sub category images.
My code for looks like this:
<div class="subcategory-products">
<ul class="products-grid two_columns_5">
<?php
$_categories=$this->getCurrentChildCategories();
if($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if($_category->getIsActive()):
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0){
$class = "first";
}
elseif ($categorycount == 3){
$class = "last";
}
else{
$class = "";
}
?>
<li class="item <?=$class?>">
<a href="<?php echo $_category->getURL() ?>"
title="<?php echo $this->htmlEscape($_category->getName()) ?>">
<img class="pic_size_subcat" src="<?php echo $_category->getImageUrl() ?>" width="100" alt="
<?php echo $this->htmlEscape($_category->getName()) ?>" /></a>
<h2><a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a></h2>
</li>
<?php
endif;
if($categorycount == 3){
$categorycount = 0;
echo "</ul>\n\n<ul class=\"products-grid two_columns_5\">";
}
else{
$categorycount++;
}
endforeach;
endif;
?>
</ul>
</div>
but when i inspect the element in my web browser it shows this –
<img class="pic_size_subcat" src="" width="100" alt="
">
so all i can tell is that it is reading in the code correctly but it isnt getting the img src. Does anybody know why? it worked before i cloned the website
Best Answer
In my experience, this is nearly always a file permission issue. Make sure that the webserver has write permissions on the
media
andvar
directory. If you set the permissions, make sure you set them recursively.