Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This is strange, i'ce tried reinstalling from scratch but couldn't fix it, basically

get_cat_name( 3 ); 

is returning an empty string even if a category with id 1 exist when making an ajax call from the frontend. Why?

share|improve this question
Does a category with ID = 3 exist, as in your code? Please provide more context for this code. That is not much to go on. – s_ha_dum Nov 29 '12 at 18:34
@s_ha_dum the problem was that was a category of a custom post type – Nicola Peluchetti Nov 29 '12 at 18:38

closed as too localized by toscho Nov 30 '12 at 5:41

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

1 Answer

Since it was a category of a custom post type, i had to use

get_term()
share|improve this answer
So it wasn’t a category at all, rather a custom taxonomy? – toscho Nov 29 '12 at 19:06
@toscho yes it was a custom taxonomy, didn't know i needed to use get_term() :) – Nicola Peluchetti Nov 29 '12 at 19:54

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