Site logo

Archived topic

Element used as Page Hero hook for archives not showing acf term meta

5 replies · Started by juanglzmx on January 11, 2022

Viewing posts 1–6 of 6

Hi, I'm setting up a GP Element on the hook as a Page Hero (after_header) for my archive pages (custom taxomies if that matters) and I'm trying to show the content of an ACF Image field as the background image for the main container, but its not working.

Also it's behaving in a weird manner, when the archive has no posts, it shows nothing as the background image, but if the archive has at least one post it actually shows the fallback background image.

My term acf field is called "taxonomy_background_image" and here is how I have it setted up:

Acf field:
ACF Field

GP Element:
GP Element

This is how it shows when the taxonomy has at least 1 post (uses fallback image):
Archive with posts

And this is when there is no posts (doesn't load any image):
Archive no posts

I'm currently working on this on local but if you need it I can upload the site somewhere.

Thanks in advanced

Hi there,

in your ACF Image Field, can you save the image as an ID ?

Thanks David!, it did the trick for the archives that have posts on them but still nothing for the archive with no posts

Archive with posts showing the image from acf field:
https://www.dropbox.com/s/pkmln7v6vtsj1mk/gp-support2-1.JPG

Archive without posts:
https://www.dropbox.com/s/53qk45gu2ff6274/gp-support2-2.JPG?dl=0

Taxonomy with an actual image from the edit page
https://www.dropbox.com/s/2f3bigkglfi4sng/gp-support2-3.JPG?dl=0

Not sure if there is any workaround to this.

Hmmm ... thats a tricky one. What happens if you set a Fallback image for the Background - does that display on the Archive without Posts ?

No, it doesn't show the fallback image either.

But well, my main concern was about the image being shown on the archives that do have posts, so if there isn't a easy workaround for the empty archives I think I'm okay with hidding them from the navigation until they have some content.

Thanks David for your help!

If we can see the empty archive page then we may be able figure out whats going on. Let us know if thats possible - if not then happy to be of help!

This archived topic is closed to new replies.