Home › Forums › General Issues › How to add custom field to a category? › Reply To: How to add custom field to a category?
Hi
i have tried to show an image and text block on woocommerce category page . I have tried almost every example .
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
$grade = get_field(‘grade’, $queried_object);
$grade = get_field(‘grade’, $taxonomy . ‘_’ . $term_id);
this code will showing me only the following output
6395, , category-ballons, , , image/png, https://i2.wp.com/kxxxxxx.com/demo/wp-content/uploads/2016/09/category-ballons.png?fit=1920%2C400, 1920, 400, Array
any of the solution didn’t works for me .
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.