[Resolved] Custom field not working in header-element

Home Forums Support Custom field not working in header-element

  • This topic has 5 replies, 2 voices, and was last updated 12 months ago by David.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1018905
    Inga

    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?

    #1019000
    David
    Staff
    Customer Support

    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.

    #1019842
    Inga

    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.

    #1019849
    David
    Staff
    Customer Support

    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.

    #1019851
    Inga

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

    #1019855
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.