[Support request] about custom field

Home Forums Support [Support request] about custom field

Home Forums Support about custom field

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #2319770
    bruce

    hello

    this https://docs.generatepress.com/article/header-element-template-tags/#custom_field-name article has update ?

    has any more details about custom_filed with gp ?

    thanks.

    #2319799
    David
    Staff
    Customer Support

    Hi there,

    that document is for the older Header Element:

    https://docs.generatepress.com/article/header-element-overview/

    Are you using that?

    As we have a better way with the Block Editor.

    Let me know.

    #2319888
    bruce

    hello david,

    need more articles about custom field and gp.

    https://docs.generatepress.com/article/header-element-template-tags/#custom_field-name

    i do not know how {{custom_field.description}} with gp.

    thanks.

    #2319932
    David
    Staff
    Customer Support

    WordPress has its own built in Custom Fields:

    https://wordpress.org/support/article/custom-fields/

    And there are plugins like ACF, PODs or Metabox that can help with adding Custom Fields.

    When you edit a post and create a Custom Field you give it a name:

    e.g my-custom-field or my-description or anything-you-want

    And a value.

    In the GP Header Element you can use the template tag to display the value of the custom field eg.

    {{custom_field.my-custom-field}}

    #2320036
    bruce

    hello

    i creat custom field like this :

    and in GP Header Element i set like this:

    but in page i only see :array,the url is https://gp.jianzhanbang.tech/acf-test

    some mistake ?

    #2320080
    David
    Staff
    Customer Support

    Try a different Name eg.

    hiwp-company

    It needs to be unique. And maybe somewhere else the name company is being used.

    #2320250
    bruce

    Hello David ,

    ok now.

    here has other question about cf:

    only header element can use template tags with cf or hook ,block, layout also can use cf.

    thanks.

    #2320251
    David
    Staff
    Customer Support

    only header element can use template tags <– correct

    If you want to use them in Block element then you can do it with GenerateBlocks plugin. Are you using GenerateBlocks ?

    #2320279
    bruce

    hello

    yes,i also buy generateblocks pro vision.

    how can i do ?

    thanks.

    #2320297
    David
    Staff
    Customer Support

    Ok 🙂

    So each GB Block has a Dynamic Data option eg. the Headline Block:

    https://docs.generateblocks.com/article/headline-overview/#dynamic-data

    1. Select the block.
    2. Enable Dynamic Data
    3. Set the Data Source to: Current Post
    4. Set the Content Source to: Post Meta
    5. In the Post Meta field add your custom field Name.

    #2320341
    bruce

    hello David:

    text is ok .

    how to use dynamic-data wich cf display image and files .

    i test it.but the image only display the url.

    thanks.

    #2320387
    Ying
    Staff
    Customer Support

    i test it.but the image only display the url.

    Not sure I fully understand, image block can only display image.

    Can you explain a bit more?

    #2320665
    bruce

    Hello Ying,

    please see this pic:

    but in fronpage only display this pic’s url.

    you can see this url:https://gp.jianzhanbang.tech/2965-2

    i mean how to display this pic not the pic’s url

    thanks.

    #2320681
    Fernando
    Customer Support

    Hi Bruce,

    You used a GB Headline Block. You’ll need to use a GB Image Block instead.

    #2320696
    bruce

    Hello Fernando,

    GB block with custom field only can display text ?

    images files can not use GB Headline Block ?

    thanks.

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