- This topic has 17 replies, 4 voices, and was last updated 2 years, 6 months ago by
Fernando.
-
AuthorPosts
-
August 22, 2022 at 2:25 am #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.
August 22, 2022 at 3:02 am #2319799David
StaffCustomer SupportHi 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.
August 22, 2022 at 4:37 am #2319888bruce
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.
August 22, 2022 at 5:20 am #2319932David
StaffCustomer SupportWordPress 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
ormy-description
oranything-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}}
August 22, 2022 at 7:05 am #2320036bruce
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 ?
August 22, 2022 at 7:44 am #2320080David
StaffCustomer SupportTry a different Name eg.
hiwp-company
It needs to be unique. And maybe somewhere else the name
company
is being used.August 22, 2022 at 8:02 am #2320250bruce
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.
August 22, 2022 at 8:04 am #2320251David
StaffCustomer Supportonly header element can use template tags
<– correctIf you want to use them in Block element then you can do it with GenerateBlocks plugin. Are you using GenerateBlocks ?
August 22, 2022 at 8:27 am #2320279bruce
hello
yes,i also buy generateblocks pro vision.
how can i do ?
thanks.
August 22, 2022 at 8:40 am #2320297David
StaffCustomer SupportOk 🙂
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.August 22, 2022 at 9:19 am #2320341bruce
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.
August 22, 2022 at 10:00 am #2320387Ying
StaffCustomer Supporti 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?
August 22, 2022 at 6:36 pm #2320665bruce
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.
August 22, 2022 at 7:25 pm #2320681Fernando Customer Support
Hi Bruce,
You used a GB Headline Block. You’ll need to use a GB Image Block instead.
August 22, 2022 at 7:47 pm #2320696bruce
Hello Fernando,
GB block with custom field only can display text ?
images files can not use GB Headline Block ?
thanks.
-
AuthorPosts
- You must be logged in to reply to this topic.