Let's take a sample scenario.
Custom Post Type:
Custom taxonomy for the
ACF image field for
term_image (Return format: image array)
faq CPT items in a grid with each item's background image set to the URL of
term_image custom field of the first
faq_category that's assigned to each item.
This is similar to our previous Taxonomy Term-specific color coding in Oxygen tutorial.
Let's define a custom function named say,
wpdd_get_tax_term_image_url_for_post() that takes three optional arguments when called:
- taxonomy name (default:
- image field name (default:
- image size (default:
and returns a string that can be used with Oxygen's Custom Attributes and Dynamic Data feature for the Repeater's Div.
Add the following PHP code snippet in your favorite code manager plugin like WPCodeBox and set it to load on front end:
Title: [Function] Get Post's Taxonomy Term Image as Background
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.