KARL: I am trying to get the image from associated category. I am also trying to do it all via IDs. I have made an acf input field called category_icon and attached it to the taxonomy Property Features. I have managed to get as far as getting the associated category ID but can't get it to display the image.
Note from Karl: This fetches the first category image, on line 58 all terms are fetched, on line 67 the first one is chosen.
To fetch them all. Loop $customtaxonomy e.g
foreach($customtaxonomy as $term) {
if($image_id = get_field('category_icon', 'property-features_'.$term->term_id)) {
echo wp_get_attachment_image($image_id);
}
}
Notice: Trying to access array offset on value of type bool in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
649
Notice: Trying to access array offset on value of type bool in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
650
Notice: Trying to get property 'term_id' of non-object in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
650
This should echo the id of the category it is in
This should echo the id of the image in that category
Relational Village
Relational Village's Email
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
96
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
122
Operator
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
96
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
122
Name
Property Two
Featured Image
Gallery
Price
£425,000
Featured Or Not
Is Not Featured
Property Features
Type
Cottage
Sale Status
For sale
Bedrooms
Notice: Trying to get property 'name' of non-object in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
802
Notice: Trying to get property 'name' of non-object in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
802
,
Bathrooms
Notice: Trying to get property 'name' of non-object in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
812
Notice: Trying to get property 'name' of non-object in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/themes/boilerplate/cpts/properties/content-single-properties.php on line
812
,
Description
Spec
Type
Fees
Attach PDF of Property Details
Other Properties in the same village
Village Features
KARL: Here I am trying check if the relational village is in the pets-welcome category of the retirement-village-features taxonomy. if it is I want it then to display the content. Below is the code that i have used to get the relational vilages id, and the if code i have used on the village content single to display the custom html. However I do not know how to make a query that asks IF $villageid is in this cat do X. Can you make it so the html is displayed if the relational village is in that cat.
Google Map of Related Village
Address
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
96
Notice: Array to string conversion in
/home/325684.cloudwaysapps.com/qgzenkvkav/public_html/wp-content/plugins/advanced-custom-fields-pro/includes/acf-value-functions.php on line
122
Property Content