Home › Forums › Front-end Issues › Custom Field Not Displaying in Front End › Reply To: Custom Field Not Displaying in Front End
Well it seems this has quit working:
<?php
$taxonomy = 'product_cat';
$queried_object = get_queried_object();
$post_id = $queried_object->ID;
$terms = wp_get_post_terms($post_id, $taxonomy, array('fields' => 'ids'));
$term_id = $terms[0];
?>
<div class="catback" style="background-image: url('<?php the_field('products_background_image', $taxonomy . '_' . $term_id); ?>');"></div>
I’m not sure why.
I have a Category image assigned and Products image assigned under the Category. The image no longer appears.
Would upgrading to PRO have caused this to stop working?
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.