I am using cfs-custom-category-fields plugin.

In their documentation it says that to get the value of a custom field in category you should use CfsTaxonomy::get('field_name')

This works well when I am in a category page, like category-24.php.

But it doesn't work in index.php.

How do I get the value in a non-category page? I tried something like this:

$cat_id = 29;
        echo CfsTaxonomy::get('arata_in_listare');

But it doesn't work.

I suppose I need to create a category page-like environment.


You have to use this function: get_post_custom_values

The first parameter is the name of the key, arata_in_listare, and the second the post id, depending on where are you making the call you might not need to pass it.

In this community we don't give support for plugins, so I'm showing you the "wordpress" way of doing this.

  • Thanks! Couldn't do it, I finally created one manually in functions.php – Claudiu Creanga Sep 11 '14 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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