Site logo

Archived topic

Custom field not working in header-element

5 replies · Started by Inga on September 25, 2019

Viewing posts 1–6 of 6

Hi,
the custom field in my homepage-header-element does not work. I named the custom field "slogan", inserted the code {{custom_field.slogan}} in my header-HTML, created on the homepage a new custom field with the same name and put some content in it. On the frontend it still shows the code {{custom_field.slogan}} instead of the content.

It also doesn't show the featured image set unter "Page Hero", only the fallback-image works.

All theses things mentioned above work well when I display it on another page. Only on the front page these things don't work.

Maybe there are conflicts, because my front page is at the same time the woocommerce-shop-page?

Hi there,

custom fields and featured images for the archive pages won't work - basically anything added via a Meta Box in the archives will be ignored by WordPress.

For that particular page it would be simplest to create a separate Header Element that contains a Custom Image and some HTML for your slogan.

Hi David,
thanks for your reply! But creating a separate header-element is exactly what I did, or am I misunderstanding something? So I just have to hard-code the slogan in the HTML and I can't give my clients the chance to change the slogan in a custom field without touching the HTML? The same with the image. Because it's the woocommerce-shop-page?
Ok, thanks anyway.

The only way around it would be to use the Advanced Custom Fields plugin. Then the custom fields could be 'stored' somewhere else and called using a shortcode.

Ok, I'll take a look at this. Thanks.

You're welcome

This archived topic is closed to new replies.