Skip to content

Instantly share code, notes, and snippets.

@MogulChris
Created September 9, 2020 21:27
Show Gist options
  • Save MogulChris/1cf7ebf031188655ebfbdd92d4969d47 to your computer and use it in GitHub Desktop.
Save MogulChris/1cf7ebf031188655ebfbdd92d4969d47 to your computer and use it in GitHub Desktop.
Bridge - archive / product category custom header image
[
{
"key": "group_5f5940423422e",
"title": "Title image",
"fields": [
{
"key": "field_5f59406a7ebf9",
"label": "Title image",
"name": "title_image",
"type": "image",
"instructions": "Leave blank to inherit the default",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"preview_size": "medium",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": ""
}
],
"location": [
[
{
"param": "taxonomy",
"operator": "==",
"value": "product_cat"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": true,
"description": ""
}
]
<?php
//Add ACF field group for title image
//~line 600
if(is_archive()){
$term = get_queried_object();
$acf_title_image = get_field('title_image', $term);
if(!empty($acf_title_image['url'])){
$bridge_qode_title_image = $acf_title_image['url'];
}
}
// if(!bridge_qode_is_title_hidden()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment