I have 10 categories. I'm trying to add an image attached to single categories. I created a categories.php template to separate them from the pages.php template, all works fine.
But when I run
<img src="<?php echo (category_custom_field('category_image'); ?>"/>
returns the image of the last category in the database (in this case the one with id 10).
I set up a little debug tool and when I run all the category functions it shows you that points all at the last category created.
Any ideas? Thanks!