[Resolved] Page Header Template Tags

Home Forums Support [Resolved] Page Header Template Tags

Home Forums Support Page Header Template Tags

  • This topic has 5 replies, 2 voices, and was last updated 6 years ago by Tom.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #552159
    Jordan

    Hi,

    I’m trying to get some custom fields (for example one field is ‘owner’) associated with the custom post type “bikes” to show up in the page header. I’ve tried using {{custom_field.owner}} but it doesn’t seem to be working for me.

    The CPT and Fields are created using WP-Types. Do the Page Header Templates only work for standard posts with custom fields? BTW, if I type in {{custom_field._thumbnail_id}} it does print the featured image of the CPT in the header so it is working for that but not for any of the custom fields.

    I’m attaching screenshots that may help figure out the issue. https://img42.com/@KMnNY

    #552252
    Tom
    Lead Developer
    Lead Developer

    As long as the name matches the name of the custom field, it should work.

    Your screenshot didn’t seem to work.

    Let me know ๐Ÿ™‚

    #552649
    Jordan

    Ok name matches field name but it doesn’t seem to be working….

    Trying screenshots again here:
    https://ibb.co/ngkPcS
    https://ibb.co/mBfqHS
    https://ibb.co/ju5PcS

    #552876
    Tom
    Lead Developer
    Lead Developer

    What if you use a capital “O” in “Owner”?

    I’m not sure how WP-Types register their meta. Perhaps there’s an underscore before the name? _Owner

    #553000
    Jordan

    Ok, thanks. So it turns out all WP-Types fields are preceded by “wpcf-”

    I added this {{custom_field.wpcf-owner}} and it now works! Thanks

    #553328
    Tom
    Lead Developer
    Lead Developer

    Awesome! No problem ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.