Archived topic
Page Header Add Custom Post Type Custom Field
9 replies · Started by Ben on July 4, 2018
Hi All,
I have a site with a Custom Post Type setup called Events, within Events I have a custom field (setup with ACF) called event_date. Is there any way to get that to display in a Page Header I have created. I tried {{event_date.name}} but it didn't work. Is it possible?
Thanks,
Ben
Hi there,
The simplest way is to use an ACF Shortcode:
https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/
Thanks David but it doesn't seem to be working for me, i've added: [acf field="{$event_date}"] to the page header content and nothing is coming through. Have I got it wrong?
Try:
[acf field="event_date"]
that did it, legend - thanks David
glad i could help
Hi David,
A further thought sorry - any idea if I can do this with a PODS custom field? I'm thinking of doing a similar thing on a site that uses PODS.
Thanks
Ben
Hi Ben,
Yes, PODs has a shortcode function that should work in the pageheader. Here's their shortcode methods:
thanks Again David, just wasn't sure if it would work with Page Headers – i'll give it a go
If you can get a PODs shortcode to output what you need in the content then it should work find the Page Header.